This is a continuation of http://drupal.org/node/1118244
Right now, by default Views will still use its heavier markup. And by design, it pretty much has to. But it would be good to make it easier for advanced users to just turn this off.
However, I think I have a way to do this.
In the 'Fields' style, we can add a checkbox:
[ ] Use no field markup by default.
If checked, the - Default - setting for a field will change to None from whatever it previously was. The field can then pretty easily just query the style to see if there should be a default override. I don't think this will be too hard to implement.
| Comment | File | Size | Author |
|---|---|---|---|
| #14 | 1124130-wrapping-html.patch | 1.46 KB | DjebbZ |
Comments
Comment #1
dreadlocks1221 commentedI agree, this would be a very useful feature, I have been messing with views for a while trying to do just that
Comment #2
wjaspers commented+1
Comment #3
merlinofchaos commentedOk, committed this to both 6.x-3.x and 7.x-3.x
Comment #4
merlinofchaos commentedThe actual checkbox is worded "Add default Views' HTML wrappers" and defaults to checked. That retains the current behavior.
This is only true for the 'Fields' row style, but really, almost everything that uses fields is either Fields or table. But it's possible that other styles might need to be updated to be able to utilize these features.
Comment #5
Darko commentedThis is fantastic. Thanks!
Comment #6
merlinofchaos commentedNote that this only affects views' FIELD markup. The styles still have their somewhat heavier row markup, and of course the view markup itself. Of course, due to multiplicative effects, the field markup was the most important simply because if you have 25 rows with 20 fields each, the 25 extra divs you might get isn't as bad as the 20 * 25 extra divs you might not want.
Still, we should look to see if the basic row styles, themselves, still need addressing. If people following this feel they do, please file separate issues with specifics about what markup/classes still need to be made optional.
Comment #7
basicmagic.net commentedthanks merlin-
yet another great improvement to your brilliant work with views... this is killer!
vincent, in buffalo
http://basicmagic.net
Comment #8
jacineHoly crap! First an awesome new UI, and now this. Wow. We are not worthy!! :D
Thank you so much!
Comment #9
jessebeach commentedwoohoo!
Comment #10
senpai commentedOk, now this is freakin' AwesomeSauce! Rock on!
Comment #11
dcmouyard commentedBuy that man a beer!
Comment #13
tchopshop commentedYes, this is wonderful, and it would be amazing to be able to control/eliminate/change the markup for rows too from the UI.
thank you!
Comment #14
DjebbZ commentedJust a small correction : the label for this option reads
when it should be
dereine just confirmed it with me (here at London DrupalCon :)
And the patch applies both to D6 and D7 version.
Comment #15
dawehnerThanks for providing a patch. Commited to 7.x-3.x