Page 1 of 1
Creating a side Menu with Navigator
Posted: Sun Jan 22, 2023 1:05 pm
by maybites
Hi
I just upgraded my server to php 8 and CMSMS 2.2.15 and the old MenuModule doesn't work anymore.
I removed it from my templates and would like to make Navigator work, but this seems to be more complicated than anticipated.
Simply adding
doesn't show me anything.
https://maybites.ch/works/
I would like to have a simple side naviagtion and would be greatfull if someone can point me to a tutorial or examples that can show me how to achieve this.
Re: Creating a side Menu with Navigator
Posted: Sun Jan 22, 2023 3:38 pm
by DIGI3
The admin log or your php error log should show you what's going wrong there (when I load your page I get a Smarty error screen). I would suspect an accidental typo when making the change, or perhaps not having a default template set when not specifying one in the tag.
Navigator actually ends up being a bit easier than MenuManager was, but both have their learning curves. The templates included are the best place to start. 90% of the time you can copy the sample template that most closely matches the MM template you were using and update a few css classes.
Re: Creating a side Menu with Navigator
Posted: Sun Jan 22, 2023 3:41 pm
by velden
The module's help can be found in Module Manager.
For a side menu you probably (also) need the
(optional) start_level="" - This option will have the menu only display items starting at the given level relative to the current page. An easy example would be if you had one menu on the page with number_of_levels=1 . Then as a second menu, you have start_level=2. Now, your second menu will show items based on what is selected in the first menu. The minimum value for this parameter is 2
or
(optional) childrenof="" - This option will display only items that are descendants of the selected page id or alias. i.e: {Navigator childrenof=$page_alias} will only display the children of the current page.
Re: Creating a side Menu with Navigator
Posted: Sun Jan 22, 2023 5:30 pm
by maybites
Thank you both for your usefull hints.
I have the side menu working again, at least almost:
I have to figure out how to display only the current level in the second column.
Re: Creating a side Menu with Navigator
Posted: Sun Jan 22, 2023 6:02 pm
by velden
I suppose number_of_levels=1
Re: Creating a side Menu with Navigator
Posted: Sun Jan 22, 2023 6:12 pm
by maybites
for future reference:
I solved it this way:
Code: Select all
<!-- Start Menu Column -->
<div id="menuLevelOne">
<!-- Start Vertical Menu -->
<div id="menu_vert">
{Navigator number_of_levels=1}
</div>
</div>
<div id="menuLevelTwo">
<!-- Start Vertical Menu -->
<div id="menu_vert">
{Navigator number_of_levels=1 start_level=2}
</div>
</div>
<!-- End Menu Column -->
CSS:
Code: Select all
div#menuLevelOne {
position: fixed;
top:200px;
left: 0px;
border-right: 1px solid #ccd0d6;
float: left;
margin-left: 0em;
margin-right: 1em;
padding: 0 0.5em 0 0;
background:#fff;
width: 180px;
}
div#menuLevelTwo {
white-space: nowrap;
font-size: 0.4em;
position: fixed;
top:200px;
left: 200px;
float: left;
margin-left: 0em;
margin-right: 1em;
padding: 0 0.5em 0 0;
background:#fff;
width: 180px;
}