开发者

Which hook should I use to manipulate node before being rendered?

开发者 https://www.devze.com 2023-03-26 19:21 出处:网络
I am developing a simple module for drupal 7.x to manipulate node content depending on the value of a cck field. Actually I am going to hide the field_presenation if the field_status = 1.开发者_如何学

I am developing a simple module for drupal 7.x to manipulate node content depending on the value of a cck field. Actually I am going to hide the field_presenation if the field_status = 1.开发者_如何学Go I tried to use hook_node_load and it worked but unfortunately it's called before viewing the node or editing it which is not what I need. I tried hook_node_view but it never got executed for unknown reason.

In drupal 6.x I used to use hook_nodeapi and check if $op = 'view' and it worked fine.


And see this page? All of these hooks are called in a description of


use hook — hook_nodeapi() see Drupal API — https://api.drupal.org/api/drupal/modules!node!node.api.php/function/hook_node_view/7

0

精彩评论

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

关注公众号