Creating a side Menu with Navigator

For questions and problems with the CMS core. This board is NOT for any 3rd party modules, addons, PHP scripts or anything NOT distributed with the CMS made simple package itself.
Post Reply
maybites
New Member
New Member
Posts: 5
Joined: Sat Jan 21, 2023 5:44 pm

Creating a side Menu with Navigator

Post 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

Code: Select all

{Navigator number_of_levels=2}
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.
User avatar
DIGI3
Dev Team Member
Dev Team Member
Posts: 1629
Joined: Wed Feb 25, 2009 4:25 am
Location: Victoria, BC

Re: Creating a side Menu with Navigator

Post 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.
Not getting the answer you need? CMSMS support options
User avatar
velden
Dev Team Member
Dev Team Member
Posts: 3483
Joined: Mon Nov 28, 2011 9:29 am
Location: The Netherlands

Re: Creating a side Menu with Navigator

Post 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.
maybites
New Member
New Member
Posts: 5
Joined: Sat Jan 21, 2023 5:44 pm

Re: Creating a side Menu with Navigator

Post 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.
User avatar
velden
Dev Team Member
Dev Team Member
Posts: 3483
Joined: Mon Nov 28, 2011 9:29 am
Location: The Netherlands

Re: Creating a side Menu with Navigator

Post by velden »

I suppose number_of_levels=1
maybites
New Member
New Member
Posts: 5
Joined: Sat Jan 21, 2023 5:44 pm

Re: Creating a side Menu with Navigator

Post 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;
 }
Post Reply

Return to “CMSMS Core”