How do you create submenus for the top menubar in the frontend?
The main menu is the partial “nav-links.htm”. Should i extend this file with the related submenues?
I’m new with October CMS. I’m trying to get familiar with the concept and i’m trying to find to best ways to “do things”.
That depends on what agreement you have with the client. If you don’t give them a way to add submenu items, then you’re restricting how much they can do. Ideally you’d build a system that gives them enough flexibility to do what they want, in a way that doesn’t cause them to mess things up.
We tend to use the static pages plugin to give clients the freedom to create as many pages as they want, and also structure the navigation however they like.
When we do this… we pass the menu items through to a partial that renders the links. And inside that partial, loop through the list items, each time checking if the menu item has any children, If it does - render the same partial and pass it the children of the current item in the loop.
With some clever css you can create exactly what you’ve sent in the screen shot.
This might sound complicated in theory, or maybe I’ve not explained it well - but in practise it’s pretty simple.