Closed (duplicate)
Project:
Node Comments
Version:
6.x-3.x-dev
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
25 Jul 2008 at 08:24 UTC
Updated:
5 Sep 2011 at 12:27 UTC
Hello,
I would like to suggest the following addition to the nodecomment module (the comments explain why):
450d449
< break;
452,458d450
< case 'view':
< // If this is a comment, redirect to the node it is a comment on.
< // This is necessary to show the relevant threads when following
< // a link from (for example) a search result.
< if (isset($node->comment_target_nid) && arg(0) == 'node' && arg(1) == $node->nid) {
< drupal_goto("node/". $node->comment_target_nid);
< }
Comments
Comment #1
crea commentedD5 branch is not supported anymore. Closing.
Please reopen if the issue is relevant with Nodecomment 6.x-2 branch.
Comment #2
nocean commentedHi crea, re-opening and re-versioning this feature request. I think this is definitely a relevant issue for 6.x-2 and going forward. Node comments should treat the comment node's location in Drupal relative to the parent thread it is a comment on, and not as an individual content item. I believe the original feature request addresses this, and I think it would be extremely useful, as having users of a site visit a page with a single comment and no context on it is sort of weird.
Update: A quick and (somewhat) dirty work around for this is creating a theme .tpl file for your node comments content type and inserting the following code at the top:
I wrapped the URL (and hard-coded the domain) in Drupal's url() function to get around some issues with the double encoding of the hash (#) symbol.
You will also need to edit the nodecomments View and change the output so it is wrapped in a DIV with the id comment-[NID]. There are several ways of doing this -- you can either theme the View using additional .tpl files in your theme directory, or as I did, simply use Views filters to modify the generated output, ie:
Then when the comment is accessed directly, it will be auto-redirected to the original content item for that comment, and the fragment (#answer-[NID]) will jump the page to the appropriate comment.
Comment #3
crea commentedSome site may want to show comment nodes on individual pages. So if we want to implement it, it should be configurable (per comment type, probably).
Comment #4
michelleDefinitely needs to be set per content type. Also, don't forget to take paging into account.
Michelle
Comment #5
1kenthomas commented//subscribing.
Comment #6
eidolon night+1
Comment #7
crea commentedComment #8
crea commentedNote that in 3.x we now have nodecomments which also work as "content" i.e. they can have own pages, own comments, etc, etc.
We will redirect to the node page if the nodecomment is not "content".
Comment #9
crea commentedSee #796866: Comments of comments.