Hi all,

I really apologise if this is the wrong place to post my question.

I am running on the current setup:
drupal-6.12
fivestar-6.x-1.15
nodecomment-6.x-1.2rc2
cck-6.x-2.3
votingapi-6.x-2.0-rc2
views-6x-2.6

on shared hosting for testing purposes.

i followed the instructions here in http://drupal.org/node/234681

even though the modules they used were a bit outdated.

I got what i wanted working. i have a product node type and a review node type. then i used nodecomment so that the review node type appears as a comment for product.

so far so good.

now when i go view the review node by itself, i cannot find the link back to the product node - the parent of the review node.

i tried searching and came across this patch. http://drupal.org/node/472900
but i am not sure how to use it. in fact i am not even sure if it solves my issue.

I don't mind having the parent node (the product node) appear as a breadcrumb, so long as there is a link back to the product node.

I bought the using drupal book but i dislike the way it taught you to select a list of products in order to create a review.

I tried searching for some time and came across nodecomment, node hierarchy and node relativity. after much experimenting, i have settled on nodecomment, but i realised i need the parent link.

Please advise.

I know very little about php and even less on drupal. But i am very serious to learn and possibly give back what i learnt.

Once again, i apologise if i post this at the wrong place.

Thank you.

Comments

lastcowboy’s picture

Hi,

i posted the same question at stackoverflow.

i got an answer which even though i have not tested fully, but i am quite sure its the one i am looking for.

see the post at stackoverflow here http://stackoverflow.com/questions/1020798/how-do-i-get-a-link-to-parent...

see the video by lullabot here http://www.lullabot.com/articles/photo-galleries-views-attach

the module that is particularly relevant to my problem is http://drupal.org/project/nodereference_url

i hope whoever has the same issue after reading the Using Drupal book can benefit from this!

cmstom’s picture

lastcowboy,

I was in the same situation as we are running Open Atrium 1.x (Drupal 6) and are using the nodecomment module as well. I needed to add a breadcrumb back to the parent node and none of the breadcrumb modules could do that, so a custom solution was needed.

I loaded up devel and viewed the node object and found comment_target_nid that provided the value of the parent NID. I tried just printing the link (1st code snippet below) but it didn't work because I wanted this breadcrumb to appear in a block and the block didn't have access to the node object.

So I used the menu_get_object() function to pass the node object into the block, as seen in the 2nd code snippet below. That worked like a charm. Hope this helps someone.

print l('Back to DIALog entry', $node->comment_target_nid);

if ($node = menu_get_object()) {
    $variables['node'] = $node;
    print l('Back to DIALog entry', $node->comment_target_nid);
}

Thomas Newman
Drupal Developer, Site Builder, Themer