Closed (fixed)
Project:
Node Comments
Version:
6.x-1.2-rc1
Component:
User interface
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
6 Oct 2008 at 13:53 UTC
Updated:
31 Aug 2010 at 15:38 UTC
Well i'm with a little trouble sorting the way to see the related nodecomment father when i'm viewing the nodecomment itself as a node.
If i'm in the node father page, all the related comments appear below, but if i'm seeing the comment node there is no relationship visible to the node father.
How can this be achieved?
The only option i see, is adding a nodereference field to the nodeccomment referencing is father. But this solutions dosnt look very clean...
Thanks in advance
Comments
Comment #1
cratos commentedOk i solved my problem. Used nodereference field with PHP code to get by default the respective node father.
here is the code:
Hope it helps someone;)
Comment #2
sirkitree commentedIf you do a node_load of any given nodecomment, you'll find a $node->pid which is the parent id. This may be another nodecomment (for threading). There is also a comment_target_nid which always holds the original parent node id.
nid1
- nid2
- - nid3
- nid4
In the above example, a node_load on 3 would have a pid of 2 and a comment_target_nid of 1.
So if you wanted to create a link on any given node to the comment_target_nid you could create a variable in your template.php that would check for this variable and display a link to the comment_target_nid (or the pid, whichever you prefer).
Comment #3
cratos commentedThat was really usefull information. Thanks for sharing your knowledge Sirkitree.
Not sure if i will adopt it in this issue, but will certainly be very usefull in near future.
Thanks
Comment #4
lastcowboy commentedhi cratos,
can you give me more details as to how your way works? i am new to drupal and know a little about php.
I am looking to have the nodecomment be able to display the link of the parent node when viewing the comment as a node by itself.
Please advise.
I am very interested to learn more.
thank you.
Comment #5
crea commentedClosing all issues. Please reopen if still relevant with Node Comments 6.x - 2.x