[solved] - Menu template question
Posted: Mon Apr 11, 2011 7:30 pm
Could anyone help me out with this ?
I am trying to specify one section ( alias ) and prevent the menu from displaying ONLY it's child elements, but display child elements of other sections. Like this :-
== SHOW THIS ==<ul>
== SHOW THIS ==<li>anotherSection</li>
== SHOW THIS ==<ul>
== SHOW THIS ==<li>anotherSection child 1</li>
== SHOW THIS ==<li>anotherSection child 2</li>
== SHOW THIS ==<li>anotherSection child 3</li>
== SHOW THIS ==<li>anotherSection child 4</li>
== SHOW THIS ==<ul>
== SHOW THIS ==<li>mySection</li>
== BUT EXCLUDE THIS ==<ul>
== BUT EXCLUDE THIS ==<li>mySection child 1</li>
== BUT EXCLUDE THIS ==<li>mySection child 2</li>
== BUT EXCLUDE THIS ==<li>mySection child 3</li>
== BUT EXCLUDE THIS ==<li>mySection child 4</li>
== BUT EXCLUDE THIS ==</ul>
== SHOW THIS ==</ul>
ie :- in the template
Any help greatly appreciated. Thanks
I am trying to specify one section ( alias ) and prevent the menu from displaying ONLY it's child elements, but display child elements of other sections. Like this :-
== SHOW THIS ==<ul>
== SHOW THIS ==<li>anotherSection</li>
== SHOW THIS ==<ul>
== SHOW THIS ==<li>anotherSection child 1</li>
== SHOW THIS ==<li>anotherSection child 2</li>
== SHOW THIS ==<li>anotherSection child 3</li>
== SHOW THIS ==<li>anotherSection child 4</li>
== SHOW THIS ==<ul>
== SHOW THIS ==<li>mySection</li>
== BUT EXCLUDE THIS ==<ul>
== BUT EXCLUDE THIS ==<li>mySection child 1</li>
== BUT EXCLUDE THIS ==<li>mySection child 2</li>
== BUT EXCLUDE THIS ==<li>mySection child 3</li>
== BUT EXCLUDE THIS ==<li>mySection child 4</li>
== BUT EXCLUDE THIS ==</ul>
== SHOW THIS ==</ul>
ie :- in the template
Code: Select all
{if $count > 0}
<ul>
{foreach from=$nodelist item=node}
{if $node->depth > $node->prevdepth}
{repeat string="<ul>" times=$node->depth-$node->prevdepth}
{if $node->alias == "mySection"}
AT THIS LEVEL DO NOT DISPLAY ITS CHILDREN ie :-
{/if}
{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="{$node->url}"><span>{$node->menutext}</span></a>
{elseif $node->children_exist == true and $node->depth < $number_of_levels and $node->type != 'sectionheader' and $node->type != 'separator'}
<li class="parent"><a class="parent" href="{$node->url}"><span>{$node->menutext}</span></a>
{elseif $node->current == true}
<li class="currentpage"><h3><span>{$node->menutext}</span></h3>
{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}"><span>{$node->menutext}</span></a>
{/if}
{/foreach}
{repeat string="</li></ul>" times=$node->depth-1}</li>
</ul>
{/if}
Any help greatly appreciated. Thanks