[NVRM] menumanager and nodes

Have a question or a suggestion about a 3rd party addon module or plugin?
Let us know here.
Post Reply
jack4ya
Power Poster
Power Poster
Posts: 294
Joined: Thu Oct 19, 2006 10:07 am

[NVRM] menumanager and nodes

Post by jack4ya »

~In menu manger (default template) I would like to repeat every item ( if it has children ) in the child level...
How do I achieve this

Trying something with
{if $node->haschildren == true}{assign var="parenttitle" value=$node->menutitle}{/if}
{$parenttitle}


Code: Select all

            <ul>
                <li>Item</li>
                 <li>(Parent) Item</li>
                    <ul>
                        <li>(Parent) Item</li>
                        <li>Item</li>
                        <li>Item</li>
                        <li>Item</li>
                        <li>Item</li>
                    </ul>
                </li>

Default template below: nothing modified et.

Code: Select all

{* 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. *}
{if $count > 0}
<div id="menuwrapper">
<ul id="primary-nav">
{foreach from=$nodelist item=node}
{if $node->depth > $node->prevdepth}

	{repeat string="<ul>" 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 and $node->haschildren == true)}
	<li class="menuactive menuparent"><a class="menuactive menuparent" 
{elseif $node->current == true}
	<li class="menuactive"><a class="menuactive" 
{elseif $node->haschildren == true}
	<li class="menuparent"><a class="menuparent" 
{elseif $node->type == 'sectionheader'}
        <li class="sectionheader"><span>{$node->menutext}</span>
{elseif $node->type == 'separator'}
        <li style="list-style-type: none;"> <hr class="separator" />
{else}
	<li><a 
{/if}
{if $node->type != 'sectionheader' and $node->type != 'separator'}
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 ne ""} target="{$node->target}"{/if}><dfn>{$node->hierarchy}: </dfn><span>{$node->menutext}</span></a>
{elseif $node->type == 'sectionheader'}
><dfn>{$node->hierarchy}: </dfn><span>{$node->menutext}</span></a>
{/if}

{/foreach}

	{repeat string="</li></ul>" times=$node->depth-1}		</li>
	</ul>
<div class="clearb"></div>
</div>
{/if}
Last edited by jack4ya on Thu Jan 15, 2015 10:52 am, edited 2 times in total.
jack4ya
Power Poster
Power Poster
Posts: 294
Joined: Thu Oct 19, 2006 10:07 am

Re: menumanager and nodes

Post by jack4ya »

{foreach from=$nodelist item=node}
{if $node->depth > $node->prevdepth}
{repeat string="<ul><li>{$node->menutext}</li>" times=$node->depth-$node->prevdepth}


I added this... but as expected it outputs the current menutext, not it the level above it.

It's not the same is current page and then parent... I need it for every parent...
Post Reply

Return to “Modules/Add-Ons”