Menu template not working with Navigator Topic is solved

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
hdriezenlive
New Member
New Member
Posts: 8
Joined: Tue Oct 09, 2018 3:35 pm

Menu template not working with Navigator

Post by hdriezenlive »

Hi,

I found out I have to switch from Menu manager to Navigator to be PHP8 compatible. However, when I change Menu into Navigator in my template, my menu no longer shows on the website. The menu-template is called correctly, but apparently is not processed.
My menutemplate looks like this:

Code: Select all

{strip}
{* CSS classes used in this template:
#menuwrapper - The id for the <div> that the menu is wrapped in. Sets the width, background etc. for the menu.
#primary-nav - The id for the <ul>
.menuparent - The class for each <li> that has children.
.menuactive - The class for each <li> that is active or is a parent (on any level) of a child that is active. *}

{assign var='number_of_levels' value=10000}
{if isset($menuparams.number_of_levels)}
  {assign var='number_of_levels' value=$menuparams.number_of_levels}
{/if}


{if $count > 0}
<ul class="menu">
{foreach from=$nodelist item=node}
{if $node->depth > $node->prevdepth}
{repeat string='<ul class="unli">' times=$node->depth-$node->prevdepth}
{elseif $node->depth < $node->prevdepth}
{repeat string='</li></ul>' times=$node->prevdepth-$node->depth}
</li>
{elseif $node->index > 0}</li>
{/if}

{if $node->parent == true or $node->current == true}
  {assign var='classes' value='menuactive'}
  {if $node->parent == true}
    {assign var='classes' value='menuactive menuparent'}
  {/if}
  {if $node->children_exist == true and $node->depth < $number_of_levels}
    {assign var='classes' value=$classes|cat:' parent'}
  {/if}
  <li class="{$classes}"><a class="{$classes}" href=
{elseif $node->type == 'sectionheader' and $node->haschildren == true}
  <li class="menuparent"><a class="menuparent" ><span class="sectionheader">{$node->menutext}</span></a>
{elseif $node->type == 'sectionheader'}
  <li><a ><span class="sectionheader">{$node->menutext}</span></a>
{elseif $node->type == 'separator'}
  <li style="list-style-type: none;"> <hr class="menu_separator" />
{elseif $node->children_exist == true and $node->depth < $number_of_levels and $node->type != 'sectionheader' and $node->type != 'separator'}
  <li class="menuparent"><a class="menuparent" href=
{else}
  <li>
  <a href=
{/if}

{if ($node->type != 'sectionheader' and $node->type != 'separator') or $node->parent == true or $node->current == true }
 {if $node->target}target="{$node->target}" {/if}
"{$node->url}"><span>{$node->menutext}</span></a>
{/if}
{/foreach}
{repeat string='</li></ul>' times=$node->depth-1}
</li>
<li><a id="xdisclaimer" href="javascript:doMenu('disclaimer');">Contact</a></li>

</ul>
{/if}
{/strip}
Any idea what can be wrong? I cannot find the cause of this problem myself.

Thanks!
User avatar
DIGI3
Dev Team Member
Dev Team Member
Posts: 1445
Joined: Wed Feb 25, 2009 4:25 am
Location: Victoria, BC

Re: Menu template not working with Navigator

Post by DIGI3 »

MenuManager templates aren't directly transferrable to Navigator in most cases. Navigator was built to be recursive, it's more powerful and uses fewer resources, but that does mean different templates.

Have a look at the sample templates included with Navigator, then create a new one to use. In most cases you'll just need to change some of the class names to match the ones you were using in MM.
Not getting the answer you need? CMSMS support options
hdriezenlive
New Member
New Member
Posts: 8
Joined: Tue Oct 09, 2018 3:35 pm

Re: Menu template not working with Navigator

Post by hdriezenlive »

Thank you for your quick reply.
Post Reply

Return to “CMSMS Core”