2

I have downloaded the Acquia Marina theme yesterday.

I cannot understand well the following code; there is a lot of code like the following, in page.tpl.php.

<?php print theme('grid_block', $search_box, 'search-box'); ?>
<?php print theme('grid_block', theme('links', $secondary_links), 'secondary-menu'); ?>
<?php print theme('grid_block', $primary_links_tree, 'primary-menu'); ?>
<?php print theme('grid_block', $tabs, 'content-tabs'); ?>
<?php print theme('grid_block', $footer_message, 'footer-message-text'); ?>
..............

Acquia Marina theme version is 6.x-3.1. I didn't find a template.php file between its files. Where is the variable declared? Why doesn't the code use $primary_links_tree directly?

1 Answer 1

1

The Acquia Marina theme is a sub-theme of Fusion core. $primary_links_tree is defined in the template file of that theme, in the fusion_core_preprocess_page(), which the preprocess function that is called before page.tpl.php is used to output a page. Starting from line 80, you find the following code:

$vars['primary_links_tree'] = '';
if ($vars['primary_links']) {
  if (theme_get_setting('primary_menu_dropdown') == 1) {
    // Check for menu internationalization
    if (module_exists('i18nmenu')) {
      $vars['primary_links_tree'] = i18nmenu_translated_tree(variable_get('menu_primary_links_source', 'primary-links'));
    }
    else {
      $vars['primary_links_tree'] = menu_tree(variable_get('menu_primary_links_source', 'primary-links'));
    }
    $vars['primary_links_tree'] = preg_replace('/<ul class="menu/i', '<ul class="menu sf-menu', $vars['primary_links_tree'], 1);
  }
  // ...
}
2
  • got it. thank you.<?php print theme('grid_block', theme('links', $secondary_links), 'secondary-menu'); ?> what's this line meaning. there are two theme() function in it.namely,when print it. the theme will look for the theme_grid_block() function and theme_links function. am i right?
    – enjoylife
    Apr 16, 2011 at 3:43
  • @enjoylife Yes, you are; those are the theme functions that are invoked, if there are no modules that override them.
    – apaderno
    Apr 16, 2011 at 3:46

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.