Drupal – chaging the content of $node through hook_node_view

Drupal has hooks, one of then is called hook_node_view which allows you to inject variables into your node templates. In order to actually modify the node with the content variables… done like so:

You need to actually return the $node variable from the hook function.

You can then use the variable in your node template.

Published on: 27 June 2014
Posted by: Sami K.