With Views, I want to output a list that links to each comment of the current node. But instead of linking to


I want to link to


I tried these fields, but they all link to the URL in the /comment/ space:

  • Comment: Title (Formatter: Plain text)

  • Comment: Title (Formatter: Comment Permalink)

  • Comment: Link to Comment


Is there a way to output anchors in the /node/ space? The solution doesn’t need to support comment pagination (a node will never reach the limit).


An ugly workaround (which will not work for paginated comments):

  1. Add the field "Content: Link to Content"

    1. Use the relationship "Content" (should be default when creating a comments view)
    2. Enable "Exclude from display"
    3. Enable "Output the URL as text"
  2. Add the field "Comment: Comment ID"

    1. Set "Formatter" to "Unformatted"
    2. Enable "Exclude from display"
  3. Add the field "Comment: Title"

    1. Set "Formatter" to "Plain text"
    2. Disable "Link to the Comment"
    3. Enable "Output this field as a custom link" (under "Rewrite results")
    4. Link path: {{ view_node }}#comment-{{ cid }}
      (field names might differ, use what’s listed under "Replacement patterns")

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.