Skip to content

Instantly share code, notes, and snippets.

@evolvingweb
Created March 30, 2012 03:14
Show Gist options
  • Save evolvingweb/2246154 to your computer and use it in GitHub Desktop.
Save evolvingweb/2246154 to your computer and use it in GitHub Desktop.
hook_node_view()
<?php
/*
* Implements hook_node_view()
*
* Adds a note to each article node
*/
function mymodule_node_view($node, $view_mode) {
if ($node->type == 'article') {
$node->content['mymodule_note'] = array();
$node->content['mymodule_note']['#markup'] =
t('My Module Was Here!');
}
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment