I’m using hook_node_view to display to content of a node instead of another one.
function mymodule_node_view($node, $view_mode, $langcode) {
if ($node->nid == 89) {
$room = node_load(90);
$node->content['mymodule_additional_content'] = node_view($room);
}
}
The template of node 90 displays "ROOM" text (for test).
But here is what is displayed instead of just "ROOM" :
ROOM
Language Français
Gabarit:
pages/chambres.tpl.php
Any idea ?
EDIT : if I replace line 5 by :
$node->content = array('mymodule_additional_content' => node_view($room));
Thus removing all other content previously added to $node->content, I get that result :
ROOM
Language Français
That means that "Language Français" is added AFTER the hook is called. But where ?
Working answer from @Clive :
It’ll be another module that implements the same hook running after yours, so your changes get added to. Try following the How to update a module’s weight guide to make your module’s hooks run after any others, that should do the trick.