Re: Multilevel (3 depth) jQuery Accordion Side Menu
Posted: Tue Dec 21, 2010 3:50 pm
well, to be honest, i have no idea for now. you could send me admin access via pm and i can take a closer look
Content management as it is meant to be
https://forum.cmsmadesimple.org/
replace the menu template (.tpl) with this onebadoul wrote:Hi nicmare
How can i do to have separate class for each li (or parent). Maybe based on the active title menu.
b
Code: Select all
{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" id="menu">
{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}
{assign var='classes' value='selected'}
{if $node->parent == true}
{assign var='classes' value='selectedparent'}
{/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}
For me too, this is perfect, with the same exception: I would need the menu to stay open. Is there any solution for this? I'm not very good with javascript or smarty... Thanks in advance for any ideas.boby wrote:This is great, just what I was looking for.
The only thing when I click on a page link, the menu closes itself.
Is it posible to get the menu open to the current page?
May be I missed something... is it easy to emplement?
thanks for any help