开发者

Drupal 7: Customize hook_view for Debut Event module is not working

开发者 https://www.devze.com 2023-02-10 21:03 出处:网络
I am trying to add a custom message under the text of event description, I tried to use hook_view like this:

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().

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号