function hook_node_view_alter

This hook hook_node_view_alter is responsible for Alter the results of node_view().

This hook is called after the content has been assembled in a structured array and may be used for doing processing which requires that the complete node content structure has been built.

function mymodule_node_view_alter(&$build) { if ($build['#view_mode'] == 'full' && isset($build['an_additional_field'])) { // Change its weight. $build['an_additional_field']['#weight'] = -10; } // Add a #post_render callback to act on the rendered HTML of the node. $build['#post_render'][] = 'my_module_node_post_render'; }

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

Up ↑

%d bloggers like this: