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 existing system, anchors for comments are provided as
<a id="comment-34"></a>
<div class="comment">...
This patch gets rid of the <a id
anchors and puts them inside the <div
which provides the same functionality, with more usefulness for css and scripting down the track i.e.
<div id="comment-34" class="comment">
.
Affected files are comment.tpl.php in each theme, as well as comment.module for the default theme and to remove the a tag.
Comment | File | Size | Author |
---|---|---|---|
#5 | comment_anchors.2.patch.txt | 4.22 KB | vik4 |
#3 | comment_anchors.1.patch.txt | 3.9 KB | vik4 |
#1 | comment_anchors.patch_0.txt | 3.36 KB | vik4 |
comment_anchors.patch.txt | 1.34 KB | vik4 |
Comments
Comment #1
vik4 CreditAttribution: vik4 commentedThat patch only changed comment.module and didn't include the template files.
Comment #2
drummGood patch, but theme_comment_folded() needs the id as well.
Please be sure to set patches that haven't been reviewed by a second person to "code needs review" instead of "ready to commit."
Comment #3
vik4 CreditAttribution: vik4 commentedRighto - fixed that.
Comment #4
drummNo longer applies to HEAD.
patching file themes/engines/phptemplate/comment.tpl.php
Hunk #1 FAILED at 1.
1 out of 1 hunk FAILED -- saving rejects to file themes/engines/phptemplate/comment.tpl.php.rej
Comment #5
vik4 CreditAttribution: vik4 commentedfixed (finally got around to using CVS rather than the cvs tarball)
Comment #6
drummSince this requires changing themes, it will have to wait for 6.0.
Comment #7
bdragon CreditAttribution: bdragon commentedDoesn't apply anymore, and probabaly needs a rewrite, what with all the theme system changes that have happened.
Comment #8
bdragon CreditAttribution: bdragon commentedBumping to D8.
Comment #9
jhedstromComment markup has gone through much evolution since this patch was added 9 years ago. At this point, I think using the anchor tag instead of a div is intentional as it allows users to easily get a direct link to the comment. Closing for now.