====== How do I create and edit the main navigation menu? ====== In CBSplit CMS the public navigation menu is a menu you build in the admin, then place in a layout or page. Open **Content > Menus**, add the pages that should appear, and rearrange them. The documented way to render that menu is the tag [[ $menu name="top_menu" ]] inside a layout, or **+ Insert a Page**, which injects the menu into a selected page. The admin's own top bar is a different menu. It is not the menu visitors see. ===== Before You Begin ===== Log in to the site admin. The [[adminoptions|Options]] article gives the admin address as the site's ''cbsplit.com'' host plus ''/admin'', or ''/admin'' on your own domain after DNS points at ''ns1.rackco.com'' and ''ns2.rackco.com''. You need an admin account that is allowed to change menus and layouts. The default SuperAdmin username is ''admin''. Extra users are added with the **+** icon at the top right, and their access can be limited. **Verification required:** the wiki screenshot of user permissions does not list the permission name for Menus. The wiki index calls this screen **Content > Menus**. The Menus page heading still says "Admin Layout > Menus". **Verification required:** confirm the current top-menu label in the admin before you rely on a screenshot. A menu does nothing by itself. A [[adminlayouts|layout]] (CBSplit's name for a theme) or a selected page has to include it. Layouts can differ for the home page, internal pages, and mobile. ===== Step-by-Step Instructions ===== - Open the admin and go to **Content > Menus**. - Create the menu or open the one already used by the layout. **Verification required:** the public article does not name the button that adds a menu, or the field where the menu's name is stored. The only name in the documentation is the example ''top_menu''. - Add the pages that should appear, then rearrange them. The Menus article says you visually add and re-arrange which pages appear. - Keep the default menu template unless you have a reason to replace it. Styling is done with your own CSS, not by a separate "theme menu" screen. See [[how-do-i-customize-css-or-styling-in-cbsplit|How do I customize CSS or styling in CBSplit?]]. - Put the menu on the site in one of the two documented ways. - Click **+ Insert a Page**. The wiki says this auto-injects the menu into the selected page. - Or copy the tag from the input above the editor and paste it into the layout: [[ $menu name="top_menu" ]] - Use the real menu name in ''name=""'' if it is not ''top_menu''. **Verification required:** the article does not show a rename control. - If the home page uses its own layout, and internal pages use another, paste the tag into each layout that should show the menu. - Open the layout's **mobile** tab. If that tab has content, phones use it instead of the default layout. Put the menu tag in the mobile layout as well, or the phone view will not show the menu you just edited. Tablet behavior is chosen in [[adminoptions|Admin Options]]. - Save the menu and the layout. **Verification required:** the Menus article does not print the save-button label. Disabled pages use page status **Disabled(Suspended)** in [[adminpages|Content > Pages]]. **Verification required:** the wiki does not say whether a suspended page remains in a menu. ===== Example ===== A product site needs three public links: the offer, the FAQ, and a contact page. Those pages already exist and are **Active(Published)**. In **Content > Menus**, those three pages are added to the menu named by the layout tag, in that order. The home layout and the internal-page layout both contain: [[ $menu name="top_menu" ]] The mobile layout tab is empty, so phones load the same layout and the same menu. After a hard refresh, the public header shows Offer, FAQ, and Contact in that order. The admin's own top bar is unchanged, because that bar is the admin navigation, not this menu. ===== How to Verify ===== - Open the public page in a private browser window so you are not looking at the admin chrome. - Confirm the link text, the order, and the targets. Each target should be the page **URL** from [[adminpages|Content > Pages]]. - If you used **+ Insert a Page**, check the page you selected, not a different page. - Resize to a phone width, or use a phone. If a mobile layout exists, confirm the menu tag is in that layout too. - From CBSplit CMS 5.8.9 onward, an admin who enabled the ''__system_front_top_bar_v1'' snippet can use the frontend toolbar to jump from the live page back to the page editor. That toolbar does not edit the menu. Menu changes stay in **Content > Menus**. ===== Troubleshooting ===== ==== The public page has no menu ==== The layout or selected page does not contain the menu tag, or **+ Insert a Page** was aimed at a different page. Add the tag to the layout that page actually uses. ==== The menu is missing on a phone only ==== The layout **mobile** tab has its own HTML, and that HTML has no menu tag. An empty mobile tab falls back to the default layout. A filled mobile tab does not. ==== Edits appear in the admin and not on the site ==== You changed the admin top menu, or you edited a menu name that the layout does not call. The tag ''name'' must match the menu you edited. ''top_menu'' is only the documented example. ==== The order is wrong ==== Re-arrange the pages in **Content > Menus**. Order is not taken from the page list on the left of the Pages module. Page folders, built with **Move selected to**, organize the admin list. They are not documented as the public menu order. ==== Styling collapsed the links ==== The default template is styled with custom CSS. A rule may be hiding the list. See the CSS article before you rebuild the menu. ===== Frequently Asked Questions ===== ==== Is the admin top menu the site menu? ==== No. [[adminhome|The admin dashboard]] says the top menu is the admin navigation and stays the same throughout the admin. Visitor navigation is a menu resource placed in a layout or page. ==== Can I have more than one menu? ==== The Menus article says you can add menu(s) as needed while creating layouts. Each one is called by its own ''name'' in the menu tag. A header menu and a footer menu are two menus, not two levels of one menu. ==== Do I have to paste the tag into every page? ==== No. Pasting it into the layout covers every page that uses that layout. **+ Insert a Page** is the documented way to inject it into one selected page instead. ==== Will a menu change publish itself to old cached copies? ==== A visitor-facing cache control is not documented. See [[how-do-i-enable-caching-to-speed-up-my-cbsplit-site|How do I enable caching to speed up my CBSplit site?]]. Check the live URL in a private window after you save. ===== Related Articles ===== * [[how-do-i-build-a-nested-or-multi-level-menu-structure|How do I build a nested or multi-level menu structure?]] * [[adminmenus|CB Split Admin - Content > Menus]] * [[adminlayouts|CB Split Admin - Content > Layouts/Themes]] * [[adminpages|CB Split Admin - Content > Pages]] * [[how-do-i-customize-css-or-styling-in-cbsplit|How do I customize CSS or styling in CBSplit?]] * [[how-do-i-set-a-homepage-or-landing-page-in-cbsplit|How do I set a homepage or landing page in CBSplit?]] * [[frontend-toolbar-feature|Frontend Toolbar in CBSplit CMS 5.8.9]]