node#comment links
taite11 - April 2, 2009 - 03:24
| Project: | Node comments |
| Version: | 6.x-1.x-dev |
| Component: | Comment module inconsistencies |
| Category: | feature request |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | active |
Description
I would like to have lists of comments that link to the comment anchor on the node page like how the default Comment module works. A link like ....com/node-alias#comment-2 for example.
For example, currently if there is a node titled "Pig" with url alias "pig" and somebody posts a comment titled "I like pigs" with url alias "like-pigs" the comment title link will link to the comment node itself which is .com/like-pigs. What I wold like is a way to link to link to the comments anchor on the "pig" page. So, for example, clicking the link would lead the user to something like .com/pig#comment-1 or .com/pig#like-pigs.

#1
Node Comments comes with a node-comment.tpl.php file to make this process easy, just copy the .tpl.php file from the module directory and put it in your theme's directory. This .tpl.php file contains the functionality you're describing.
But I agree, it'd be good to have this be "automatic" for you, instead of requiring this manual step. I'd like to have a nodecomment.tpl.php file included with Node Comments module, and call our own theme function that prefers this .tpl.php file if it is available, but otherwise uses the normal node-[nodetype].tpl.php file.
#2
I see.
Is there a way to use URLs of that format in Views? Users could click the title "Bob's Review" and be sent right to the proper position on that page. As of now, I've only figured out how to allow users to click "Bob's Review" and go to either the parent node (top of the page - so they have to scroll around to find "Bob's Review") or go to just that child node (where they can't see the other reviews or the parent).
#3
If you use a node-listing within views (i.e. using the default nodecomments or nodecomments_threaded views), then this will happen automatically when using the node-comment.tpl.php file.
#4
" Is there a way to use URLs of that format in Views? "
"If you use a node-listing within views (i.e. using the default nodecomments or nodecomments_threaded views), then this will happen automatically when using the node-comment.tpl.php file."
Glad to have found this thread. Could you please explain how exactly you use threaded views... what do you mean by "use node-listing". Just want to create simple view/block that does exactly what you were talking about. Been strugling with this for weeks.
Thank you in advance!
And also, when you are about to post a node-comment, are you able to get it to open submition form on a new page? I get it under the post by default, and can not change it under content type comment settings.
#5
Sollution, if somebody still looking for it. 2.x version of the nodecomment module is slightly different than the old one. It works with the old comment module somehow (newbie here, don't ask). It offeres in views option to show field called "node comment link", which asks if the node is used as a node comment, and than provides the "comment link", not the node link. Than under options for node comment link, you work with some replacement patterns (se the pic), and that's it.
#6
One slight correction, so you don't bang your head when you don't get this working right away. The regular "node:title" field must still be there, in views, added before the node comment link field, but you just "exclude it from the view" under settings for "node title". So that way i recon it gives info about the node title to node comment field bellow.