Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Thank you for this fantastic module, it really helps creating clean html output. I noticed that when using the semantic style and row style in Views to make a class-free unordered list, that the final html source code (when for example viewing the source in a browser) has a lot of white space and line breaks between the views rows. For example I have up 5 line breaks between a
and
. It makes the html source overview chaotic. Is there anything that can be done about that?
Comments
Comment #1
Anonymous (not verified) CreditAttribution: Anonymous commentedComment #2
Anonymous (not verified) CreditAttribution: Anonymous commentedComment #3
DanH CreditAttribution: DanH commented@adr75
One way to do it...
- Go into the "semanticviews" module folder and remove some of the line breaks in semanticviews-view-fields.tpl.php
Comment #4
DanH CreditAttribution: DanH commentedActually, don't hack the semanticviews-view-fields.tpl.php file directly - better to override.
Override the semanticviews-view-fields.tpl.php file by copying it into your active theme folder and then remove the line breaks. You may need to clear cached data to see the changes. ( Administer > Site Configuration > Performance ---> Clear cached data )
Comment #5
jerdavisThis was causing me some grief for a couple of fields I wanted to have defined as spans and butting up against each other. For example if you have a name field and then a position field, and you want to output as such:
I ended up rewriting the semanticviews-view-fields.tpl.php in a theme level override as such:
Comment #6
mansspams CreditAttribution: mansspams commentedsubscr.
Comment #7
inlikealion CreditAttribution: inlikealion commentedbangpound, what would it take to get this pushed into a release? How can I help?
Comment #8
inlikealion CreditAttribution: inlikealion commentedSetting status to "needs review". The above 'patch' theme override gives me much better white space and hasn't appeared to blow anything up for me, either. Can anyone more knowledgeable chime in on the quality of the above code? Does it work for anyone else?
Comment #9
milesw CreditAttribution: milesw commentedWorks nicely for me.
Comment #10
mxmilkiib CreditAttribution: mxmilkiib commentedworking fine for myself, thanks jerdavis
Comment #11
mxmilkiib CreditAttribution: mxmilkiib commentedSame issue exists in 7.x. As above, converting the new template from PHP in HTML to HTML in PHP works again to remove whitespace.
Comment #12
Scyther CreditAttribution: Scyther commentedIs this still a problem with the 7.x version of this module?
Comment #13
Scyther CreditAttribution: Scyther commented