开发者

How do I create multiple menus for different pages in Drupal?

开发者 https://www.devze.com 2023-01-25 21:54 出处:网络
How do I add a link from the home page that goes to a new page with a different menu? Example: from home page, click on \'Sales Department\' menu link, which goes to the Sales Department page. This s

How do I add a link from the home page that goes to a new page with a different menu?

Example: from home page, click on 'Sales Department' menu link, which goes to the Sales Department page. This shows a new menu with ten new menu items on the Sales Department Page.

I am able to create menus, menu items, blocks and pages but unsure how to build a multi-menu structure as described a开发者_JAVA百科bove.


Menus, by default, have a UI presence in the form of a block. Within each block, you can specify which pages it will or will not show. This will give you the appearance of having content/page specific menus.

For instance, menu1 will only show on /home. Within menu1 there is a link to a page called /contact. On /contact, there is another menu (menu2) with links /contact/email and /contact/phone. For the menu1 block, the specified pages are / and /home. For the menu2 block, the specified pages are /contact and /contact/*.


Add menus in blocks and specify in which page each menu should be visible. Look in the block setting properties: you can add the pages there.


After a bit of playing around, this is what worked for me:

  1. Create a new page called "Human Resources Page". Link to parent item "Navigation Page". Enter a menu link title "Human Resources Page" (otherwise it will not appear in menu).

  2. Create a new menu called "Human Resources Menu" (human-resources-menu) Show block on specific pages: <front>.

  3. Add menu item called "Organization Chart".
    Attach to parent menu "Human Resources Menu".

  4. In blocks, assign "Human Resources Menu" to "Right Sidebar" Set "Page specific visibility settings" to hr*.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号