Tip for Recent Comments

jules wanted a way to link directly to a comment using the Recent Comments tag, and this seemed to work just great:

<a href=”{permalink=”weblog/comments”}#{comment_id}”>link to comment</a>

The addition is the #{comment_id}. Because EE auto puts in an anchor tag using the comment_id, this makes it easier to link directly to that certain comment.

How does this post make you feel?
  • Excited
  • Fascinated
  • Amused
  • Bored
  • Sad
  • Angry
This entry was posted in Uncategorized by Yoshi. Bookmark the permalink.

8 thoughts on “Tip for Recent Comments

  1. This works great, but I’m using pagination for comments, and for me the links don’t work if the comment in question isn’t on the first page.  :-(

  2. For some reason I am not getting comment_id’s by default, do I need to add <a name="{comment_id}"> to my comment page?

  3. No, you shouldn’t have to do that. it’s built into the comments tag. Although I do see plenty of anchors in your page.

  4. hmm looking at that page, it looks like you have 2 sets of anchors per entry. One set numbers from 0 to x and the other one looks right, with something like 7xxx as the id’s. Just kind of odd that you had to add them in yourself.