Playing Using Secondary Menus
Problems viewing videos?
Download latest Quicktime Player
Stay connected
Recent
Podcasts
- Drupal Voices 82: Jacine Rodriguez on the Skinr Module
- Drupal Voices 81: Laura Scott on Interaction Design
- Drupal Voices 80: Yves Chedemois on the History and Future of CCK
- Drupal Voices 79: Daniel Kudwien and his many Drupal development contributions
- Drupal Voices 78: Wolfgang Ziegler on the Rules Module
RSS Feed


Comments
Thanks
Another great introductory screencast,
Thank you for sharing :-)
Yes is great,
Yes is great, thanks.
Jay,
--------------------------------
email extractor
Wow, i can't believe I overlooked this functionality!
I've been looking for some way of doing this and kept coming up empty. I can't believe I completely overlooked that small paragraph of text saying why you'd want to link primary / secondary links.
Thanks, great work!
Great
Awesome! Addison you're great at explaining things simply! Quick question, in the vid you opt for changing the class instead of overriding with css. Is that generally the more semantic / ideal way in your opinion?
Thanks for the knowledge!
Fernando Vela
Drupal Ninja in Training
No ideal
Honestly, I would say it depends on how you want to set up your theme. I mainly played with the classes to show folks that they could. Sometimes it is just easier to bypass all the existing CSS or you already have an HTML/CSS design that you are trying to match. Typically I would just override the CSS. But again, it depends on what the existing CSS is doing and what other things I have going on in my theme. Basically, the "ideal way" for me is the way that is the least amount of work to achieve my goal. :-)
Thanks
Awesome. Thanks for the follow up!
Breadcrumbs
Loved this trick. Thank you for that nugget. But why oh why isn't the breadcrumb feature "activating" both the "section" and the "secondary page" -- you know, like tabs and secondary links.
I've had to use modules to force Drupal 6 to really make the breadcrumbs work, and still they don't always work.
Thanks for any more help you give and thanks for the fabulous screencast.
Primary link to stay selected
I echo Josh's comments - great and informative screencast as usual, but how do one make the primary link stay selected when navigating to one of its secondary pages? Sure, you can sniff out which page you're on and set a CSS class accordingly, but there must be a *clean* way of doing this, using the menu code and tapping into the primary-secondary relationship? Thanks, keep up the good work!
Use Menu block module
You could use the 'Menu block' module (http://drupal.org/project/menu_block). It makes it incredibly easy to accomplish what (I think) you're after.
Took me a while to figure this out 'manually' and then I stumbled upon that little module. Works great.
Menu Trails is the answer
You need to check out http://drupal.org/project/menutrails for keping primary and secondary active when viewing a page.
Works brilliantly....!
Quick and Useful
Thanks for taking the time to do this video. I'm new to Drupal and overlooked this as well. You do a great job of getting to the short and sweet of it without skipping over the layout aspect!
Thank you!
Thank you for this video! It was an inspiring video for me as a template designer who's learning Drupal :)
Well done
As a teacher a really appreciate the clear and concise instructions you give.
left div
I learned something today, thanks. I was wondering about how to do exactly that...
A remark though, when adding the secondary menu to the left side bar you must also change the condition of appearance of the left bar div: if empty, the second level menu will not appear.
Cross-over Navigation
This is very interesting, I always wanted know, how to construct something like a "Cross-Over"-Navigation in Drupal. That means: you have a main-navigation at the top of the page and a sub-navigation in one of the side-bars.
Since this kind of cross-over-navigation is very often used on web-sites, there should be the possibility in Drupal to configure it automatically.
But your solution comes very near to that, what I wanted to know.
With one exception: if the secondary menu is moved to the left-side-bar it seems to me(probably there is still something what I'm doing wrong!), that only the first level of the navigation is shown. If this menu has some more sub-menues they are not shown.
Another hint: If you are trying to make the changes within in the Garland-theme and the secondary menue is moved to the left-side-bar it gets the same color as the background. This means it eventually becomes invisible! So be sure to change not only the list-styles but also the color in the appropriate css-class.
How to theme $secondary_links in menu_tree
Thanks for the great tutorial. I think setting 'primary links' as the source for the secondary links as you've shown is a very elegant solution. However, now I'm unable to reference these links inside menu_tree so that I can format them in template.php. menu_tree('secondary-links') doesn't work because that menu is empty and menu_tree($secondary_links) doesn't work because it's an array and not a menu name.
Addison rocks!
Thanks for the great tutorial! You have a nice way of explaining things to newbies - so that it makes sense.
Bug "User" as top menu item
After puzzeling for a hour it looks like there is a bug.
When using the profile page of the user (path="user"), the secondary links don't display.
I will work around this using a view displaying the users profile page.
work around for the bug "User as topmenu"
I have found a way around the bug.
The Bug: If the top level menu items points to the users profile (path = user), the secondary menu items won't display
The resolution. Point your top menu item to "user/%", and the secondary menu shows!
problems!
Thanks so much for this video Addison, it's exactly what I was looking for! I'm running into a little problem though. I've themed my site to all hell, and when I finally found this video I tried changing my settings accordingly. I followed your instructions to the T, but the children menus are still not showing up for me.
I've got the secondary menu source as the primary, and i've got the PHP calling for the secondary like in your example. All that shows up though is an empty field below the primary links with no secondary links... so it makes me think that I'm almost there, something is just telling those links to not show up. Is there something I could have changed that would not allow the secondary menu to show?
wow! that has saved me so
wow! that has saved me so much time. Thank you very much! xx
Wohoo!!
I was trying for ages to figure this out when using the primary menu as a block. After an hour or two realised it must be me that didn't get it. Found this tutorial and learning about the menu settings and making both menus reference primary was the ticket. Thank you Addison, flippin brilliant!!
Sorry to go against the
Sorry to go against the grain here but once again Drupal has stumped me even with this clearly presented vid.
I have a fresh clean install of Garland theme 6.10 and the EXACT same set up as on the vid yet the secondary links do not show up!
I'm thinking its a theme config issue I'm missing out on (like how the Search box doesn't appear by default) but I cannot see anything obvious. Else the other thing it may be is what my menus link to- currently they are pointing to pages within the site. Perhaps I need to set up blocks in a certain way. Taxonomy maybe? I have tried various things but none of them seem to work.
There are no prerequisites at the start and I'm guessing I don't have to code anything....Any suggestions anyone?
Same problem here. I have no
Same problem here. I have no idea how to solve it....
Me too...
They don't display by default, but if I'm on the page, they display.
It's most likely a config thing, but I can't see to figure it out...
Great trick, great software
Thanks for the video. It really helped me.
But I have a little stupid question: what is the nice software do you use, that display both page and html code (and possibly DOM)?
Or may be it is a plugin for some browser?
Firebug
That is the Firebug plugin for Firefox. http://getfirebug.com/
is it just me, or is the
is it just me, or is the video missing?
There for me
The video is there for me when I click the Play tab. Do you have the latest Quicktime player in your browser?
wow great missing video...so
wow great missing video...so informative :)
I'm having a horrible time
I'm having a horrible time implementing the secondary links as a child of primary. I've tried many different themes none of which worked. Secondary links will only be displaying as children of primary in an unordered list. I can't move the php sinipet around and have any effect at all. Are there any addons require to get this to work?
feel free to see for your self.
http://garywroberts.com/elliot/jbrokers/
admin
password
Menu block?
Have you tried the Menu Block module? It provides the ability to place a child-of-primary block on your page. You can even do child-of-secondary and so on. It's very flexible and provides some ought-to-be-in-core functionality.
jeff, Your solution was
jeff, Your solution was exactly what I needed. I'm not sure why the standard way of doing it wouldn't work for me, probably a server issue, but regardless Menu Block did the same thing. Thank you so much for taking the time to tell me about it.
Short coming with the way secondary menu is...
You can only see the "current" secondary menu. If you are so where on the Flowers section, you can't hover over Tree and see its secondary menu. Visitor cannot find thing easily. They have to click each primary menu to see every secondary menu. I wish we don't have to resort to something like nice menu for this.