Created
April 20, 2015 05:51
-
-
Save xtfer/a5ff0a4a305645260f8a to your computer and use it in GitHub Desktop.
Example of hook_node_view
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 | |
/** | |
* Hook structure. | |
*/ | |
function hook_node_view($node, $view_mode, $langcode) { | |
// Do something here. | |
} | |
/** | |
* Implements hook_node_view | |
*/ | |
function my_module_name_node_view($node, $view_mode, $langcode) { | |
$node->content['my_additional_field'] = array( | |
'#markup' => '<p>Some additional content.</p>', | |
'#weight' => 10, | |
); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment