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.
Beside using hook_preprocess_panels_pane()
, you can also use hook_ctools_render_alter()
.
Check out Meta tags never rendered when using Panels for an example.
See also Document the amazing hook_ctools_render_alter()
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With