drupal 7: page manager/panels and hook_node_view

I'm trying to run some custom code on a particular type of node when it is viewed. Just a little bit of code I used to implement with nodeapi. This works fine in Drupal 7, but since I am overriding the node_view page in ctools page manager it doesn't fire.

function mymodule_node_view($node, $view_mode, $langcode) {
  if($node->type=='webform') {
    drupal_set_message('test');
    // actual code will go here 
  }
}

Is there a different core function that could be used? Or a ctools page manager hook that I haven't found?

I could probably execute some code in a preprocess theme override somewhere but it doesn't feel like the best thing to do.

6
задан Kevin Brown 19 March 2015 в 20:51
поделиться