I want people to see a view instead of the node. The view will have more than one content type in it. It will have the original node plus the content from an additional node type.

Is there an easy way to do this?

Thanks in advance for your assistance.

Comments

nevets’s picture

I would suggest using panels for this. It includes the ability to override the node/# path on a per content basis.

vsr’s picture

That looks like a very complicated module. Would ite easier to create a template for the content type and place the views in the template? Such as, "questions_page.tpl". Then when they go to the content, they would see the views instead of the normal page view. Would this mess things up?

Something like:

First view.

<php
$view=views_get_view("questions"):
$display=$view->execute_display("default", $nid):
print #display["content"]
?>

Then below the second view.

<php
$view=views_get_view("questions"):
$display=$view->execute_display("attachment", $nid):
print #display["content"]
?>

Thanks about the idea about panels.

nevets’s picture

Using panels this should be easy and is really the way I would go.

Another option to consider is to use a node reference field in your "main" content type, but this depends on what relates the two nodes.
There is also a field type to attach a view.

If you are going to override a template make a content type specific copy of node.tpl.php. For example if your content type is 'questions', copy node.tpl.php to node-questions.tpl.php. Edit node-questions.tpl.php and add

$view=views_get_view("questions"):
$display=$view->execute_display("attachment", $node->nid):
print $display["content"]

at the end.

vsr’s picture

I went with the Views Attach Module

Thanks for your assistance.