Community

accessing page.tpl.php variables in node.tpl.php

Hi!

Due to issues with the way drupal theming handles single node pages vs. generated pages, I've got to move $tabs/$messages to a different location when viewing single nodes. The simplest way I can think to do that is to conditionally print them in node.tpl.php when $page is TRUE.

So, I either need to understand how to access page.tpl.php variables directly or how to pass them through preprocess... Any help would be incredibly... helpful. ;-) Thanks!

Comments

What are the issues with the

What are the issues with the way drupal theming handles single node pages vs. generated pages that you are trying to deal with?

Maybe these variable

Maybe these variable definitions will help http://api.drupal.org/api/function/template_preprocess_page/6
But I am curious what you need to do too.

Solved!

Thanks! Forest for the trees was my problem today.

In order to move $tabs/$messages/$help into node.tpl.php, I did this in template.php:

function phptemplate_preprocess_node(&$variables){
$variables['tabs'] = theme('menu_local_tasks');
$variables['messages'] = $variables['show_messages'] ? theme('status_messages') : '';
$variables['help'] = theme('help');
}

hi there, i am trying to

hi there, i am trying to achieve the same thing... adding $messages varibale to node.
i tried your code but it did not work for me!

I am on D6!

nobody click here