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.
In the default node.tpl.php in node.module, we have print $terms
. Because $terms is a list, this is invalid html markup (lists are not allowed inside spans). This was the only w3c html validation error I got with drupal 6. I propose changing the span to a div and setting the div to display: inline. This shuts up the validator and looks the same.
Comment | File | Size | Author |
---|---|---|---|
#10 | terms_3.patch | 971 bytes | Jody Lynn |
#2 | terms.patch | 951 bytes | Jody Lynn |
terms.patch | 952 bytes | Jody Lynn | |
Comments
Comment #1
Jody Lynnsorry, that code was supposed to read ''$terms'', but is getting altered
Comment #2
Jody Lynnlol. Take 3, this time with code tags:
<span class="terms"><?php print $terms ?></span>
Also noticed an oversight in my previous patchComment #3
dvessel CreditAttribution: dvessel commentedNice catch. :)
Comment #4
Gábor Hojtsy.terms sounds like a pretty too broad selector to add now. What about making it more specific, so we are not breaking stuff elsewhere?
Comment #5
Jody LynnI disagree Gabor. The .terms selector was already the one being used. The only way this change will affect people will be if their themes were using a span.terms selector, since if they were just using .terms it will have the same behavior now. Changing it to something else will do more harm than good since existing stylesheets would need to be changed.
Comment #6
Gábor HojtsyWell, I cannot see where was the .term selector used except in Garland:
So if someone has a theme which has a class="terms" outside of the node terms list (eg. in a sidebar or whatever), it is affected by this change, since you are introducing the first selector on this in a core module. All stuff with class="terms" will be display:inline, while before this patch, nothing applied to class="terms" if you were not using Garland.
Comment #7
Jody LynnOk, so how about if it becomes something like
<div class="terms terms-inline">
and then.terms-inline {display: inline; }
so that .terms still applies as it used to.Comment #8
dvessel CreditAttribution: dvessel commentedUsing a more specific selector does make sense but that then depends on the theme. The markup in the default node.tpl.php isn't even used by default but do we use a selector specific to that anyway? I'm not sure. Would 'div.terms' be specific enough?
edit: Lynn, that could work too.
Comment #9
Gábor HojtsyWell, the code in question is right in node.tpl.php anyway, so it is dependent on a theme as well. .terms-inline could also work.
Comment #10
Jody LynnHere's a patch with the .terms-inline selector.
Comment #11
dvessel CreditAttribution: dvessel commentedTested on a CSS based theme.
Comment #12
Gábor HojtsyThanks, committed.
Comment #13
Anonymous (not verified) CreditAttribution: Anonymous commentedAutomatically closed -- issue fixed for two weeks with no activity.