0

I am trying to print action "tabs" in my node.tpl.php file. I added the preprocess function as below-

function MYTHEME_preprocess_node(&$variables, $hook) {

 $variables['page_tabs'] = menu_local_tabs();

}

Then trying to print in my tpl like below.

print $page_tabs;

But it is not getting executed at all. Infect the control is not going inside preprocess function when I am trying to exit like below-

function MYTHEME_preprocess_node(&$variables, $hook) {

 echo "good bye";
 exit;

}

Any help is greatly appreciated. Thanks

1 Answer 1

0

For using this hook, u will have to replace MYTHEME with your theme name, like if your theme name is bartik, then your function will be

bartik_preprocess_node(&$variables, $hook)

After that clear your cache, by going to Configuration >> Development >> Performance

or just write in url admin/config/development/perfromance

7
  • I tried that but its not happening. Jan 10, 2016 at 4:11
  • What is your theme name, where r u writing this code..? Jan 10, 2016 at 15:39
  • I am using bootstrap theme. And I am adding a new file node.vars.php under theme/system folder. Jan 11, 2016 at 15:35
  • Dont create node.vars.php, try to write this function in template.php file Jan 12, 2016 at 6:40
  • Tried that too. Jan 12, 2016 at 16:44

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.