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.
advanced-forum.naked.post.tpl.php
and many similar templates have this structure at the front of the page:
<div id="node-<?php print $node->nid; ?>
This result in many DIVs on the page having the same ID, which is contrary to HTML standards. Please, add something unique like the comment.cid.
Comment | File | Size | Author |
---|---|---|---|
#1 | af7_1367808.patch | 1.32 KB | troky |
Comments
Comment #1
troky CreditAttribution: troky commentedCheck this patch.
Comment #2
djg_tram CreditAttribution: djg_tram commentedJust as good. On a site I used "notes-{nid}-{cid}" but anything that makes it unique is just fine.
Comment #3
troky CreditAttribution: troky commented$post_id variable was already defined in preprocess function and gives "post-{nid}" for nodes and "post-{cid}" for comments.
6.x-2.x branch should be affected, too.
Comment #4
MichelleNope and I double checked to be sure. 6.x has:
<div id="<?php print $post_id; ?>" class="<?php print $all_classes; ?>">
No idea why it wasn't that way in D7 unless maybe it was fixed after you ported.
Michelle
Comment #5
troky CreditAttribution: troky commentedThanks for checking this Michelle. My fault in porting process probably.
Comment #6
MichelleI don't remember when that got fixed but I do know it was broken in 6.x at one point so my guess is it was fixed after you ported and didn't get marked to port the fix. So probably my fault in that case. ;)
Michelle
Comment #7.0
(not verified) CreditAttribution: commentedTypo