The title says it all. I have comments enabled and the default "Recent comments"-view active. The block has a list of comments linked to the comment. ()

This is pretty ugly in my case as you see nothing more than on my regular node. (http://www.mydomain.com/mynodealias)

My question is: How can I change the default view "Recent comments" to link comments to
http://www.mydomain.com/mynodealias#comment-137
instead of
http://www.mydomain.com/comment/137#comment-137

Thank you!

Comments

WorldFallz’s picture

just edit the view and use the rewrite options on the 'comment: title' field to specify the path you want to use.

Danic’s picture

I did, but there is nothing to choose but "Comment: Title" [subject]. I need something like /[node-which-was-commented]/[current-comments-number]

WorldFallz’s picture

ah ok... just add the 'content: nid' and 'comment: id' fields before the field you are rewriting and check the 'exclude from display' option. That will give you access to the tokens, but not show them in your view.

Danic’s picture

That worked as a charm. First, the tokens did not show up, then I discovered I had to put rearrange the fields and place them above the field, where I want to include the tokens.

Thank you.

LeMale’s picture

Hi,

I'm trying to do the something but with path alias instead of node id, I added the field content-path, but I get this problem:
in views Link path, when I enter [path]#comment-[cid], the result is http://nodealias/#comment-256, not http://domain.com/nodealias/#comment-256, and if I check "Use absolute path", the result is http://domain.com//nodealias/#comment-256 .

Do you have an idea how to fix this ?

ayesh’s picture

Here is a tiny module that redirects comment/x paths to nodealias?page=pagerid#comment-id.

http://drupal.org/sandbox/Ayesh/1578662 (my own module and working nice for me FYI)

This module does NOT rewrite any path. Just the redirection.