Drupal 7: Customize hook_view for Debut Event module is not working
I am trying to add a custom message under the text of event description, I tried to use hook_view like this:
function debut_event_view($node, $view_mode) {
开发者_如何学Python $message= "This is a message";
$node->dynamicinfo= $message;
$node->content['dynamicinfo'] = array(
'#markup' => $message,
'#weight' => 2,
);
}
but, the message didn't show up under the description when I view the event isn't the debut event a content type module ?? is my way to do it wrong ??
in general, whats the best way to append a message to the content type view ?
You can only use hook_view() if you are the module that defines the node type in hook_node_info(). You probably want to use something more like hook_node_view().
精彩评论