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.

CommentFileSizeAuthor
#14 1124130-wrapping-html.patch1.46 KBDjebbZ

Comments

dreadlocks1221’s picture

I agree, this would be a very useful feature, I have been messing with views for a while trying to do just that

wjaspers’s picture

+1

merlinofchaos’s picture

Status: Active » Fixed

Ok, committed this to both 6.x-3.x and 7.x-3.x

merlinofchaos’s picture

The 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.

Darko’s picture

This is fantastic. Thanks!

merlinofchaos’s picture

Note 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.

basicmagic.net’s picture

thanks merlin-
yet another great improvement to your brilliant work with views... this is killer!

vincent, in buffalo
http://basicmagic.net

jacine’s picture

Holy crap! First an awesome new UI, and now this. Wow. We are not worthy!! :D

Thank you so much!

jessebeach’s picture

woohoo!

senpai’s picture

Ok, now this is freakin' AwesomeSauce! Rock on!

dcmouyard’s picture

Buy that man a beer!

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

tchopshop’s picture

Yes, 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!

DjebbZ’s picture

Status: Closed (fixed) » Needs review
StatusFileSize
new1.46 KB

Just a small correction : the label for this option reads

If checked, fields that are not configured to customize their HTML elements will get no wrappers at all for their field, label and field + label wrappers. You can use this to quickly reduce the amount of markup the view provides by default, at the cost of making it more difficult to apply CSS.

when it should be

If not checked, fields that are ...

dereine just confirmed it with me (here at London DrupalCon :)
And the patch applies both to D6 and D7 version.

dawehner’s picture

Status: Needs review » Fixed

Thanks for providing a patch. Commited to 7.x-3.x

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.