The place to talk about things that are related to CMS Made simple, but don't fit anywhere else.
pschoenb
Forum Members
Posts: 92 Joined: Sun Jul 15, 2007 1:18 pm
Post
by pschoenb » Mon Sep 07, 2015 9:29 pm
Hello,
my page template contains:
Code: Select all
<div id="avmenu">
{menu start_level="2"}
</div>
I added the following menu template to my design (Type "Navigator::Navigation"):
Code: Select all
{if $count > 0}
<ul class="nav nav-stacked">
{foreach from=$nodelist item=node}
{if $node->depth > $node->prevdepth}
{repeat string="<ul class=\"nav nav-stacked\">" 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}
<li><a href="{$node->url}"{if $node->accesskey != ''} accesskey="{$node->accesskey}"{/if}{if $node->tabindex != ''} tabindex="{$node->tabindex}"{/if}{if $node->titleattribute != ''} title="{$node->titleattribute}"{/if}><dfn>{$node->pagetitle}</dfn>{$node->menutext}</a>
{elseif $node->current == true and $node->haschildren == true}
<li><p class="active">{$node->menutext}</p>
{elseif $node->haschildren == true}
<li><a href="{$node->url}"{if $node->accesskey != ''} accesskey="{$node->accesskey}"{/if}{if $node->tabindex != ''} tabindex="{$node->tabindex}"{/if}{if $node->titleattribute != ''} title="{$node->titleattribute}"{/if}>{$node->menutext}</a>
{elseif $node->current == true}
<li class="active"><p>{$node->menutext}</p>
{elseif $node->type == 'sectionheader'}
<li class="sectionheader"><span>{$node->menutext}</span>
{elseif $node->type == 'separator'}
<li class="separator" style="list-style-type: none;"> <hr />
{else}
<li><a href="{$node->url}"{if $node->accesskey != ''} accesskey="{$node->accesskey}"{/if}{if $node->tabindex != ''} tabindex="{$node->tabindex}"{/if}{if $node->titleattribute != ''} title="{$node->titleattribute}"{/if}{if $node->target != ''} target="{$node->target}"{/if}>{$node->menutext}</a>
{/if}
{/foreach}
{repeat string="</li></ul>" times=$node->depth-1}</li>
</ul>
{/if}
But I get:
Code: Select all
<div id="avmenu">
<!-- MenuManager is not a plugin module -->
</div>
What am I doing wrong?
Regards,
Patrick
velden
Dev Team Member
Posts: 3497 Joined: Mon Nov 28, 2011 9:29 am
Post
by velden » Tue Sep 08, 2015 9:04 am
Please use the {Navigator} tag in stead of {menu}
http://docs.cmsmadesimple.org/introducing-cmsms-2-0
The Navigator module
The Navigator module is the new module use to generate navigations on the front of the website. Like the MenuManager module, it uses the content page tree as its basis for data, and Smarty templates to form that data into an HTML Navigation.
Unlike the MenuManager module, this module generates and provides to Smarty a hierarchical dataset. This dataset can be used recursively within Smarty. This makes the navigation templates more simple and more logical to understand. It also allows for advanced functionality like giving special classes based on the first or last child of an item, its index, and its depth.
This module does not have an admin interface. The Design Manager module manages the templates for the Navigator module, and there are no other settings. It supports the same options as the MenuManager module and provides breadcrumb functionality as well.
From sample template (Minimal):
Code: Select all
{* Start Navigation *}
<div style="float: left; width: 25%;">
{Navigator loadprops=0 template='minimal_menu'}
</div>
{* End Navigation *}
pschoenb
Forum Members
Posts: 92 Joined: Sun Jul 15, 2007 1:18 pm
Post
by pschoenb » Tue Sep 08, 2015 11:41 am
Now, that is weird. The Navigator module installs fine, but still I get:
Code: Select all
Syntax error in template "tpl_body:17" on line 37 "{navigator template="accessible_simple_menu" start_level="2"}" unknown tag "navigator"
Regards,
Patrick
pschoenb
Forum Members
Posts: 92 Joined: Sun Jul 15, 2007 1:18 pm
Post
by pschoenb » Tue Sep 08, 2015 12:41 pm
Ok, the Navigator tag itself is recognized now. But instead of the menu, I get:
Code: Select all
<div id="avmenu">
accessible_simple_menu
Simple menu
</div>
Do I have to adapt my menu template above somehow?
Regards,
Patrick
pschoenb
Forum Members
Posts: 92 Joined: Sun Jul 15, 2007 1:18 pm
Post
by pschoenb » Tue Sep 08, 2015 1:06 pm
After changing the template again, the navigator tag is unknown again. No changes of the module config.
Regards,
Patrick
pschoenb
Forum Members
Posts: 92 Joined: Sun Jul 15, 2007 1:18 pm
Post
by pschoenb » Tue Sep 08, 2015 1:12 pm
After deleting the cache, the tag is known again.
Regards,
Patrick
pschoenb
Forum Members
Posts: 92 Joined: Sun Jul 15, 2007 1:18 pm
Post
by pschoenb » Tue Sep 08, 2015 3:58 pm
Ok, this one is solved, except that caching seems to be not fully reliable at times.
Regards,
Patrick