====== How do I build a nested or multi-level menu structure? ======
**Draft. Nested menu items are not documented.** CBSplit's Menus article tells you to add pages to a menu and visually re-arrange them. It also tells you to render a named menu from a layout with [[ $menu name="top_menu" ]], or to inject it with **+ Insert a Page**. It does not describe a parent item, a child item, a depth limit, or a submenu control. Do not follow another CMS's "drag under Products" steps on this screen.
===== Before You Begin =====
Read [[how-do-i-create-and-edit-the-main-navigation-menu|How do I create and edit the main navigation menu?]] first. You need access to **Content > Menus** and to the layout that prints the menu. Exact permission names are not published. **Verification required:** confirm them on the user-permissions screen before you hand this task to a restricted account.
Decide what "nested" means for this site:
* Several separate menus, such as a header menu and a footer menu. This is documented. The Menus article says you can add menu(s) as needed.
* One menu whose items contain child items. This is not documented. Treat any click-path for it as unverified.
Page folders are also a different feature. In [[cmsfolders|Pages]], you select pages in the left panel and use **Move selected to**, then **New Folder** or an existing folder. Snippet insertions can target "selected page folders". Nothing in those articles says a folder becomes a submenu.
===== Step-by-Step Instructions =====
==== Documented: order items and use more than one menu ====
- Open **Content > Menus**.
- Open the menu whose ''name'' matches the tag in the layout. The published example is ''top_menu''.
- Add the pages that belong in that menu.
- Re-arrange them until the order matches the way the default template should print them. The article's words are "visually add and re-arrange".
- For a second region, such as a footer, use another menu and another tag, for example a different ''name'' value. **Verification required:** the wiki never shows a second sample name, so confirm that the name in the tag is the name stored on the menu.
- Paste each tag into the layout region where that list should appear, or use **+ Insert a Page** when the menu belongs on one page only.
- Style the default template with CSS. The Menus article says the output is an XHTML/CSS menu from the default template plus your custom CSS. It does not publish the template's tags, classes, or list depth.
==== Not documented: a child level under one item ====
Stop here if the design needs a Products item that opens child links. The public wiki does not provide the control, the saved data shape, or the HTML the default template emits for a child level.
**Verification required:** on a staging site, check whether the menu editor has an indent, parent, or drag-under-item gesture. If it does not, a nested list has to be written into a layout or snippet by hand. That hand-built list is ordinary HTML. It is not the menu module, and it will not pick up later menu edits unless you maintain it yourself.
Do not invent a parent field on the page editor. [[adminpages|Content > Pages]] publishes Name, URL, content, meta fields, A/B testing, page status, Home Page, tracking pixels, and Part of Sitemap. It does not publish a parent page.
===== Example =====
A catalog site wants "Offer", "Ingredients", and "Reviews" in the header, and "Privacy" plus "Contact" in the footer.
Both lists are flat. Create or edit two menus. Point the header layout at the first:
[[ $menu name="top_menu" ]]
Point the footer area at the second menu with its own ''name''. **Verification required:** replace that second name with the name the Menus screen actually stores.
Reorder Offer, Ingredients, and Reviews in the header menu. Reorder Privacy and Contact in the footer menu. Preview the public page. You should see two lists, not one list with indented children.
A Products submenu with child links is out of scope for this example until the editor's nesting behavior is confirmed.
===== How to Verify =====
- View the public page in a private window.
- Check the header order and the footer order separately.
- View source and find each menu tag's output. A single flat list means the default template printed one level. Child ''ul'' or ''ol'' elements appear only if the template or your hand-written HTML produced them. The wiki does not promise that structure.
- On a phone, repeat the check against the mobile layout when that tab has its own HTML.
===== Troubleshooting =====
==== Indenting an item does not create a submenu ====
That gesture is not part of the published Menus instructions. Stop changing the live menu and confirm the control on a staging site. If no parent control exists, use a second menu or hand-written markup in the layout.
==== The footer repeats the header ====
Both regions call the same ''name''. Give the footer its own menu name and tag.
==== Folder moves changed the admin, not the public menu ====
**Move selected to** organizes the Pages left panel. Rebuild the public order in **Content > Menus**.
==== Child links show on desktop and not on mobile ====
The mobile layout is a separate HTML body. Copy only the markup you intend phones to see. An empty mobile tab uses the default layout instead.
==== A hand-built nested list went stale ====
The menu module updates tags that call a menu by name. HTML you typed into a layout does not track later adds and removes in **Content > Menus**.
===== Frequently Asked Questions =====
==== Does CBSplit support three levels of navigation? ====
Not in the published Menus documentation. Re-ordering and multiple named menus are the documented tools. Depth is **verification required**.
==== Will the Home Page setting create a parent item? ====
No. **Home Page** on the page editor marks which page is the home page. It is not a menu parent.
==== Can CSS fake a dropdown? ====
Only if the default template, or your own HTML, already contains the child elements to show and hide. CSS cannot invent child pages. The template's class names are not published. **Verification required:** inspect the rendered markup before writing a hover rule.
==== Are page folders the same as namespaces? ====
The folder tool is the left-panel **Move selected to** control. The wiki does not describe DokuWiki-style namespaces for CMS pages. Snippet insertions can target selected page folders, which shows that folders are an admin grouping used by insertions.
===== Related Articles =====
* [[how-do-i-create-and-edit-the-main-navigation-menu|How do I create and edit the main navigation menu?]]
* [[adminmenus|CB Split Admin - Content > Menus]]
* [[adminlayouts|CB Split Admin - Content > Layouts/Themes]]
* [[cmsfolders|How to organize CBSplit pages by folder?]]
* [[adminsnippetsinsertions|CB Split Admin - Content > Snippets Insertions]]
* [[how-do-i-customize-css-or-styling-in-cbsplit|How do I customize CSS or styling in CBSplit?]]