Drupal - Panels - ctools_menu_secondary_local_tasks


Author Message
Karsten "Kars-T" Frohwein

Posted: 12/28/2009
Quote message 

Hi,

I lost a lot of hair to figure how the panel tabs get into the system. My Atisteer theme won't show any. If I removed phptemplate_preprocess_page() my tabs would show if the function was active they where missing. After a lot of search I finally figured that dear merlin of chaos did hack the menu system. In ctools menu.inc you can read:
Quote :

* - First, Drupal doesn't really allow this. CTools lets this happen by
* overriding the theme function that displays the tabs. That means that
* custom themes which do not use CTools functions will not get the new
* tabs.
You can provide instructions to your users about how to deal with
* this, but you should be prepared for some users not getting the new tabs
* and not knowing why.


Great thanks Earl -_-

Knowing this its easy to provide a workaround:

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

if(module_exists('ctools')) {
$primary = ctools_menu_primary_local_tasks();
}
else {
$primary = menu_primary_local_tasks();
}
if (!empty($primary)) {
$vars['tabs'] = '<ul class="arttabs_primary">'.$primary.'</ul>';
}

$vars['tabs2'] = '';
if(module_exists('ctools')) {
$primary = ctools_menu_secondary_local_tasks();
}
else {
$primary = menu_secondary_local_tasks();
}
if (!empty($secondary)) {
$vars['tabs2'] = '<ul class="arttabs_secondary">'.$secondary.'</ul>';
}
}

As far as I can see artisteer is not using the color module and this possibly is a left over from garland copy & paste. So I left this away. Please consider to move this into your core or how you call it.

Best regards,

Kars-T - comm-press
 
Mark C

Posted: 2/18/2010
Quote message 

Kars,

What file does this code need to be added to and where abouts in that file should I put it to get panels to work?

Thanks,
M.

 
rennsix

Posted: 12/8/2010
Quote message 

M.

If you copied the Garland theme to your sites/all/themes folder you would just paste the above code inside the template.php page.

You will find that in the existing template page there is a line that starts with:
function phptemplate_preprocess_page(&$vars) {

Simply paste the code above and your panels edit tab will appear.

hope that helps