I mean, can I add an existing menu as a sub-menu of another? For example, I have an subject index menu and would like to add that as a tab to my main menu.
Thanks.
I mean, can I add an existing menu as a sub-menu of another? For example, I have an subject index menu and would like to add that as a tab to my main menu.
Thanks.
This is a limitation of Backdrop and other CMS. The menu links are all pages, so typically, "About Staff" is a piece of content (a page), and all its children are pages as well. So, clicking "About Staff" will open the About Staff page (which you could manually make into a bulleted list of children - not ideal).
So, the module yorkshirepudding mentioned, Special Menu Items, is a good way to provide "just a parent link" or placeholder that will not open anything, but instead would show its children when hovering over it.
I haven't tried this in the front end, but the administration backend has a way for menu items to automatically render an index of children. This is done (programmatically) as follows (inside an implementation of hook_menu()
):
$items['admin/structure/scheduling'] = array( 'title' => 'Scheduling', 'description' => 'Configure settings for scheduling.', 'page callback' => 'system_admin_menu_block_page', 'access arguments' => array('access administration pages'), 'type' => MENU_NORMAL_ITEM, 'weight' => 50, 'file path' => backdrop_get_path('module', 'system'), 'file' => 'system.admin.inc', );
In this example, visiting admin/structure/scheduling will open an index of all children (that is, other items that start with admin/structure/scheduling, such as "admin/structure/scheduling/students" and "admin/structure/scheduling/teachers" ). This index only displays the first level of children. You can see examples of this being used in several core modules.
Hi @leeksoup
Look at the Special Menu Items module which allow you to have placeholder menu items without links.
I'm not aware of any way to do this without some custom code and I'm not aware what code would be, if it is even possible.
OK, thank you, @yorkshirepudding.
I am a little confused about how hierarchical menus work ... the documentation shows an example like this:
Homepage
About Staff
- Senior staff
- Executive staff
Contact us
- Directions to our office
- Maps
Login
But apparently "About Staff" is a link itself, AND has leaf links under it? I could do something like this manually, but what would the Subject Index link (equivalent to "About Staff" in the doc example) contain?
Hi @leeksoup
Look at the Special Menu Items module which allow you to have placeholder menu items without links.
This is a limitation of Backdrop and other CMS. The menu links are all pages, so typically, "About Staff" is a piece of content (a page), and all its children are pages as well. So, clicking "About Staff" will open the About Staff page (which you could manually make into a bulleted list of children - not ideal).
So, the module yorkshirepudding mentioned, Special Menu Items, is a good way to provide "just a parent link" or placeholder that will not open anything, but instead would show its children when hovering over it.
I haven't tried this in the front end, but the administration backend has a way for menu items to automatically render an index of children. This is done (programmatically) as follows (inside an implementation of hook_menu()
):
$items['admin/structure/scheduling'] = array( 'title' => 'Scheduling', 'description' => 'Configure settings for scheduling.', 'page callback' => 'system_admin_menu_block_page', 'access arguments' => array('access administration pages'), 'type' => MENU_NORMAL_ITEM, 'weight' => 50, 'file path' => backdrop_get_path('module', 'system'), 'file' => 'system.admin.inc', );
In this example, visiting admin/structure/scheduling will open an index of all children (that is, other items that start with admin/structure/scheduling, such as "admin/structure/scheduling/students" and "admin/structure/scheduling/teachers" ). This index only displays the first level of children. You can see examples of this being used in several core modules.
This is a limitation of Backdrop and other CMS. The menu links are all pages, so typically, "About Staff" is a piece of content (a page), and all its children are pages as well. So, clicking "About Staff" will open the About Staff page (which you could manually make into a bulleted list of children - not ideal).
I wanted to add that another way is to create a short page for "About Staff", and add a sidebar menu (you can do this with layouts) that displays a submenu of children of "About Staff". This way people can still see the subitems of that page.
And, you can get even more creative - instead of creating a content page for About Staff, you can create a layout page with that path (and add it to the primary menu). In that layout page you can place a menu block instead of a body.
I wanted to add that another way is to create a short page for "About Staff", and add a sidebar menu (you can do this with layouts) that displays a submenu of children of "About Staff". This way people can still see the subitems of that page.
And, you can get even more creative - instead of creating a content page for About Staff, you can create a layout page with that path (and add it to the primary menu). In that layout page you can place a menu block instead of a body.