By redtray on
Hello,
I understand how to print node content in custom templates. However, I am not finding any docs on printing fields from parent nodes.
My_node has a parent (my_parent_node) using Entity Reference module. I want to print some fields from 'my_parent_node' in the template for in node-my_node.tpl.php.
Would this be as simple as print $field_my_parent_node_field[0]['value'] ??
Any help is greatly appreciated.
T
Comments
Place this code in your template
The $parent_node object will contain all the parent information you can use in whatever manner you desire.
Looking to Migrate from Drupal 6/7 to Drupal 10/11? Have a look at our Drupal 11 demo site and request access.
Many thanks!
Many thanks!