How do I create horizontal tabbed menus?

walterbyrd - December 11, 2005 - 04:09

I see tabed menus on over the place with drupal, but I can't figure out how to make one.

Quite a few contrib themes

Richard Archer - December 11, 2005 - 04:35

Quite a few contrib themes have tabbed menus.
Or build your own with CSS.

There's no magic "tabbed menus" button anywhere.

visit

wellsy - December 11, 2005 - 04:48

this resource to find some excellent html code and css examples and then add the html code to your primary links area and the css content to the style.css file in your default theme.

wellsy

orchidsonline.com.au

MENU_LOCAL_TASK

nedjo - December 11, 2005 - 05:23

The tabs are generated by menu items of type MENU_LOCAL_TASK. Look through some of the core modules to find examples of usage. If you see a particular tab and want to know where it's defined, a search on the core modules for t('whatever the tab says') should help.

Here's another method

bomarmonk - December 11, 2005 - 05:44

This looks good... I've thought about using this style of "sliding door" tabs for a horizontal menu.

There's a pretty good discussion of it here:
http://www.alistapart.com/articles/slidingdoors/

primary with second level links

NicoDruif - August 27, 2008 - 16:19

In the version I work with (6.4) you can achieve horizontal tabbed navigation with the primary links. Visit Administer > Site building > Menus > Settings and make sure "Menu containing primary links" and "Menu containing secondary links" are set to the same menu (most likely "Primary Menu" ). Then add the secondary items as children of the appropriate primary item. Your theme will also need to print the secondary menu (links).

More about this (for example) at: http://drupal.org/node/300641 and http://drupal.org/node/263438 and http://drupal.org/node/270875.

www.druifdesign.nl

Does not work as expected

lockev3.0 - October 2, 2009 - 12:11

Hello from the future (2009 vs 2008 ).

I proceed as u say, firstly creating myMenu source for primary and secondary links. Then I start to add items in the primary with primary as parent, and then the same with the secondary with the recently created primary items as parent.
As soon as i start my hierarchy, it all passes to be a hierarchy hanging from myMenu, leaving empty primary and secondary links as well.

.....what will I be doing wrong ?!?!

add secondary @ primary

NicoDruif - October 5, 2009 - 08:02

hello future!

so, you have set alle soruces of menus to the primary links? then you add all your menu items, so both primary AND secondary items in the primary menu. In the primary menu you can then create your hierarchy.

When your template files are able to show secondary menu items, you should be able to see them.

That must be the point

lockev3.0 - October 5, 2009 - 12:17

I guess that's the point (so then i do not understand the need for a 3rd menu 2 b created) , anyway the problem for me it is that the theme i use (contrast) seems to compose all the stuff related to primary and secondary in a var called $navigation ..... other way I don't know cause I don't find any references to $primary or $secondary in all phps. So when I try something like
...
echo count($primary);
...

result is 0, thoug I check out for sure I've got primary links defined (a whole hierearchy indeed).

.....in other words, i do not know how to handle this in 'contrast' theme. And i do not find info about it ....

Tnx past : )

so... when you switch to

NicoDruif - October 6, 2009 - 18:48

so... when you switch to another theme, like garland, you do see the hierarchy you want?

you might be able to copy it from this other theme?

horizontal tabbed menu

lockev3.0 - October 7, 2009 - 13:31

not really ...

Anyway, when editting the menus (presentation apart) any time I add one item to the secondary links and set its parent to the adecuate item of
the primary links, at the end it all ends in a primary links hierarchy full and a secondary links hierarchy empty. And if I am not messing my self, I think i followed the steps you suggested to achieve this. What I exactly want is what you've got on http://www.druifdesign.nl/ ..... that structure is driving me mad !

The presentation in my theme I guess i'll have to deal with particular var $navigation and CSS to activate secondaries only when hover on primaries.

I built my theme on the Zen

NicoDruif - October 10, 2009 - 11:15

I built my theme on the Zen theme's starterkit. Maybe that's something to test around with?

The css workaround might work as well though.

So, are you really sure that you're adding all your menu items under the primary links? I did not use the secondary links at all. I put all my menu items under primary links, and created the hierarchy there by dragging and dropping the menu items in the right place and hierarchy. Under admin/build/menu/settings the source of the secondary links is set to the primary links...

That's it

lockev3.0 - October 21, 2009 - 09:08

I must be messing completely the primary and the secondary links. As I understood one of your first posts, I thought I had to place the main menu options at the primary, and then the options/items to be shown in the line right below I placed them at secondary ...... now I see my mistake. Just put secondary source to be the primary and set all the hierarchy at primary.
As for the Zen theme, I'll try it ..... hope I can move my nice stuff already built upon another theme.

Thanks. Nico for your patience.

great, your welcome

NicoDruif - October 28, 2009 - 11:46

great, your welcome

 
 

Drupal is a registered trademark of Dries Buytaert.