Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
By s3a on
Where are variables such as page, messages and tabs set?
For example, where is the tabs variable from the following syntax (excluding the word "and" and the whitespace before and after it) set (initially)?:
if ($tabs):
and
print render($tabs);
If my question is unclear, in any way, please let me know so that I can make it clearer.
Any input would be GREATLY appreciated!
Comments
One of two places. Either the
One of two places. Either the variable is defined in hook_theme, and is passed to the theme implementation when it is invoked, or else the variable is generated in a _preprocess function for the theme hook in question.
Check with template_preprocess_page function
$tabs is set in template_preprocess_page()
$page array contains top level elements for each block region
ex:
$page['page_top']
$page['header']
$page['sidebar_first']
$page['content']
$page['sidebar_second']
$page['page_bottom']
See this function for reference template_preprocess_page(&$variables)