Just like the title says, how to convert the normal(like Bluemarine...) style tab to ZEN sliding door style tabs....

I've download ZEN.. and what's next?

Thanks :)!

Comments

marcvangend’s picture

What's next, depends on your destination. Are you editing an existing theme or are you creating your own? If you're creating your own theme, make it a Zen sub theme. This is by far the easiest way to enjoy all the advantages of the Zen theme. Read the Zen documentation if you want to know how to make a zen sub theme.

luisfeng’s picture

Thanks for you reply!
I am modifly an exsiting theme(not zen).
I am thinking that maybe I can copy some function,css and the related images from ZEN to my theme, and then get the ZEN style tabs...!!

marcvangend’s picture

I think you don't have to override theme functions (not sure though). Try copying tabs.css and all images to your own theme and add the css to your page in the .info file.

luisfeng’s picture

OK, I'll try it ! Thanks ^^!

luisfeng’s picture

I tried, but nothing happened. They must override the theme function...because they need extra ID or CLASS to create the sliding door tabs...

marcvangend’s picture

You're right, I missed something. The Zen theme contains a file called template-menus.php. Copy this to your theme folder, rename the functions (replace 'zen' with your template name) and include the file by adding include_once 'template-menus.php'; to your template.php. Alternatively, you can paste the functions directly in your template.php.

PS. Do not forget to clear your cache after making changes like this.

luisfeng’s picture

I can't find the template-menu.php in the ZEN package... and I find two functions seem related to Tabs in template.php...

/**
 * Implements theme_menu_item_link()
 */
function zen_menu_item_link($link) {
  if (empty($link['localized_options'])) {
    $link['localized_options'] = array();
  }

  // If an item is a LOCAL TASK, render it as a tab
  if ($link['type'] & MENU_IS_LOCAL_TASK) {
    $link['title'] = '<span class="tab">' . check_plain($link['title']) . '</span>';
    $link['localized_options']['html'] = TRUE;
  }

  return l($link['title'], $link['href'], $link['localized_options']);
}

/**
 * Duplicate of theme_menu_local_tasks() but adds clear-block to tabs.
 */
function zen_menu_local_tasks() {
  $output = '';

  if ($primary = menu_primary_local_tasks()) {
    $output .= '<ul class="tabs primary clear-block">' . $primary . '</ul>';
  }
  if ($secondary = menu_secondary_local_tasks()) {
    $output .= '<ul class="tabs secondary clear-block">' . $secondary . '</ul>';
  }

  return $output;
}

I'll try the code when my server is up... Drupalvaluehosting is really bad, allways down and without any service...!!!

Thanks for your guidance and your patients... :)

luisfeng’s picture

It works !!
Thanks marcvangend!!!

marcvangend’s picture

Great, I'm glad you found the right functions. I must have been looking at an older version of Zen...