Hello,
Sooo, I have a 3 level menu,
-LEVEL1 ITEM A
--- LEVEL2 ITEM A
--- LEVEL2 ITEM B
--- LEVEL2 ITEM C
---- LEVEL3 ITEM A
---- LEVEL3 ITEM B
---- LEVEL3 ITEM C
---- LEVEL3 ITEM D
---- LEVEL3 ITEM E
---- LEVEL3 ITEM F
-- LEVEL2 ITEM D
-LEVEL1 ITEM B
-LEVEL1 ITEM C
I need to show only subitems of certain 2nd level item, for example on homepage. How would I do that? It should be easy I suppose but cant figure it out. I wanted to do it using a View which would create a Block for me, but there is no option like that to select in Field setting of the View, is it?
I am building a site for a client so it has to be all dynamic and simple, when he adds a page to certain level of menu, it needs to be shown up automatically.
Thank you!
Comments
page specific visibility settings for submenu blocks
i'm not sure if it'll help in your situation, but the way we usually handle "contextual" menus like this is to:
1) create the submenus as separate menus
2) use the blocks admin interface to assign the submenu blocks to the correct region
3) use the "Page specific visibility settings" in the block configuration so the appropriate submenu blocks only appear on specific urls
Thanx arh1, I am using
Thanx arh1,
I am using pathauto to generate URLs, such as www.example.com/level1/level2/level3, So if I create separate menus, how can I set up this kind of hierarchy?
In pathauto settings for node path, I have this parameter: [menupath-raw] set. It works if the menu is single and hierarchical, will it with multiple menus?
Thank you
theme_menu_tree
Wow. Just found this,..
http://www.nicklewis.org/a-practical-tutorial-on-drupals-menu-system
Looks very promising. It allows me to create blocks with PHP code to output certain level of menu hierarchy. Wich is exactly what I need.
let core do it for you
the downside of having your theme explicitly render a menu based on its ID is that it's an extra step to maintain. if you want to show a different menu, you have to edit your theme file. if you decide you only want to show the menu for a certain user role, you have to edit your theme file and duplicate some of the logic from Drupal core to get it done.
so if you're OK with a URL scheme like you've listed above, IMHO using Drupal's admin interface to edit menus and blocks is the way to go. you could just create a separate menu for "level1-level2", and in the configuration for that menu's block, set the "Page specific visibility settings" to "Show on only the listed pages.":