Last active
August 29, 2015 13:57
-
-
Save petebarnett/9414025 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
template_preprocess_node(&$vars) { | |
$field_name = 'your_entityreference_field'; | |
$nid = $vars['content'][$field_name]['#items'][0]['target_id']; | |
// Add a flag to the referenced node for theming | |
$vars['content'][$field_name][0]['node'][$nid]['#node']->some_arbitrary_flag = 'some arbitrary value'; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment