Something is really bothering me. As I have developed my custom theme, I stumbled upon the problem that I cannot edit profile fields because the theme won't display the secondary local tasks.

The first thing I did was checking whether $tabs2 was included in my theme. And it was:

        <?php if($tabs) { ?><div class="tabs"><?php print $tabs ?></div><?php } ?>
		<?php if($tabs2) { ?><div class="tabs2"><?php print $tabs2 ?></div><?php } ?>

I dug then a bit deeper and checked template.php for $tabs2

function _phptemplate_variables($hook, $vars) {
  if ($hook == 'page') {
    if ($secondary = menu_secondary_local_tasks()) {
      $output = '<span class="clear"></span>';
      $output .= "<ul class=\"tabs secondary\">\n". $secondary ."</ul>\n";
      $vars['tabs2'] = $output;
    }

    // Hook into color.module
    if (module_exists('color')) {
      _color_page_alter($vars);
    }

    return $vars;
  }
  return array();
}

I tried to print $secondary, I have tried the devel module dprint_r() etc but nothing has helped me yet.

Also important is to mention that when I enabled the standard Drupal theme, it does print the second tabs. So the problem is really at the theme side.

What could be going wrong? Any ideas?

Thanks for your help.

Best regards,

Kris

Comments

rank’s picture

I was able to display the secondary tabs by replacing function _phptemplate_variables() in template.php with function phptemplate_preprocess_page():

function phptemplate_preprocess_page(&$vars) {
  $vars['tabs2'] = menu_secondary_local_tasks();

  // Hook into color.module
  if (module_exists('color')) {
    _color_page_alter($vars);
  }
}

I also modified my phptemplate_menu_local_tasks():

function phptemplate_menu_local_tasks() {
  return menu_primary_local_tasks();
}

After applying the changes don't forget to:
- flush the cache (admin -> site config -> performance -> 'clear cached data' button
- reload the theme (visit admin -> themes)

Ran