x
 
Create New Page
 View Previous Changes    ( Last updated by alienne )

Comment Permalinks

Question:

How can I automatically create a permanent link to each comment?

Answer:

Method 1:

<a href="{permalink}" title="direct link to this comment">Permalink</a>

Method 2:

<a href="{url_title_path=weblog/comments}#comment{comment_id}">Comment
#1 by John ..... </a>

You would also need, of course, to set the anchor that you’re referencing. The best way to do this is simply by wrapping the comment in a div tag with the ID attribute set:

<div id="comment{comment_id}"> THE COMMENT </div>

You can also just put an empty anchor tag at the top of the comment with the name attribute set. However, this is deprecated in recent versions of HTML/XHTML.

<a name="comment{comment_id}"></a>

If you are using an XHTML 1.1 DOCTYPE declaration, make sure to use the “id” attribute instead of the “name” one.

Category:Comments Category:Tips

Categories: