Hi, the theme_hook_suggestions in "node_reference_preprocess_node(&$vars)"
$vars['theme_hook_suggestions'][] = 'node-reference';
$vars['theme_hook_suggestions'][] = 'node-reference__' . $field['field_name'];
$vars['theme_hook_suggestions'][] = 'node-reference__' . $node->type;
$vars['theme_hook_suggestions'][] = 'node-reference__' . $field['field_name'] . '__' . $node->type;
don't redirect to templates with names like theme/.../node-reference.tpl.php or other ...
I change it to
$vars['theme_hook_suggestions'][] = 'node__nodereference';
$vars['theme_hook_suggestions'][] = 'node__nodereference__' . $field['field_name'];
$vars['theme_hook_suggestions'][] = 'node__nodereference__' . $node->type;
$vars['theme_hook_suggestions'][] = 'node__nodereference__' . $field['field_name'] . '__' . $node->type;
and then it works with filenames like node--nodereference.tpl.php.
Robert
| Comment | File | Size | Author |
|---|---|---|---|
| #2 | node_reference-985370-2.patch | 1.09 KB | matason |
Comments
Comment #1
cezaryrk commentedUpdate,
the value of $field = $node->referencing_field; is the fieldname, so i changed $field['field_name'] to $field, now it works fine
Comment #2
matason commentedI came across the very same issue, the attached patch fixes this for me.
Comment #3
cezaryrk commentedThanks
Comment #4
yched commentedCommitted #998848: node_reference template suggestions for referenced node in a specific view moder are wrong.