Theming a node reference field in a template file I have two content types:


Course
Subject


The Course nodes have a field reference field which references a Subject node.

In the Course node display, I want to have access to the variables from the corresponding Subject node. I've set the field to render as 'rendered node', but I need to rearrange the fields from both nodes to construct a tabbed interface out of all of the fields available.

What's the best way to proceed?
Hi you can use theme_render_template() function like below.


$subject_node_object = node_load('node/' . $node_id_from_ref_filed);// Pass your node ref here.
// Use below code in your course node template.
print theme_render_template(drupal_get_path('theme', 'YOUR_THEME_NAME') . 'PATH_TO_TEMPLATE/subject-node.tpl.php', $subject_node_object);


You need to create a template for you subject content type fields.