I've created two content types, Father and Son.
A Father, as you probably already know :), can have multiple Sons.
The Son content type has a "Node reference" CCK field called "field_father".
When the user goes on /father/123 (where 123 is the nid), it's shown the Father node 123 and then the "Add new comment" form.
Now, I'd like to show a summary of its Sons (I've already created it using the Views module), instead of the form to add comments.
In other words, I want to display a view on bottom of a node content: how can I do that using Drupal 6?
I would avoid editing the theme template files by hand, since I will use another theme (I still don't know which one).
I've just installed the Panels module: can I use it for this purpose?
Thanks for any advice.
Giovanni
Comments
From what I understand, for
From what I understand, for this type of situation you *will* have to edit a template file, although it's not a big deal.
If your "father" nodes don't use a custom template, duplicate node.tpl.php and call it node-father.tpl.php (if your custom content-type's machine-readable name is called "father", otherwise modify the filename accordingly).
Then, in the template file, add the following where your want your view to be added:
print views_embed_view('VIEW_NAME', 'VIEW_DISPLAY');Replace VIEW_DISPLAY with 'page_1' or 'block_1', for example.
It's possible to send arguments to Views this way. For example, if a view has an argument of "User : User ID" and is set to filter only Blog Posts, then it's possible to show a list of blog posts by the author of the node by adding:
print views_embed_view('VIEW_NAME', 'VIEW_DISPLAY', $node->uid);This gets the User ID of the $node being output and sends it as an argument to the view being embedded.
Also checkout :
http://thedrupalblog.com/embedding-view-drupal-6-using-views-embed-view
http://drupal.org/node/11816
Hope this helps.
Or you could try using
Or you could try using http://drupal.org/project/viewfield or http://drupal.org/project/viewreference
Another approach
I did something similar recently using just views and pathauto/token.
Create a block display of the sons view and place the block at the bottom of the content region (the name depends on your theme). It can get the current node's nid as an argument matching the sons to father link.
In my case, I used pathauto and token to assign a path of /father/123 to father nodes (as you seem to have done), then configured the son view's block to shown on only pages "/father/*".
With an appropriate theme, the block below the node content can appear to the user to be seamlessly part of the content.