CMS Made Simple Forums
https://forum.cmsmadesimple.org/

Multilevel (3 depth) jQuery Accordion Side Menu
https://forum.cmsmadesimple.org/viewtopic.php?f=4&t=48733
Page 2 of 2

Author:  nicmare [ Tue Dec 21, 2010 3:50 pm ]
Post subject:  Re: Multilevel (3 depth) jQuery Accordion Side Menu

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

Author:  concentre [ Wed Dec 29, 2010 2:43 pm ]
Post subject:  Re: Multilevel (3 depth) jQuery Accordion Side Menu

Well -- I never could figure out how to get an additional level, so I ended up using a completely different solution. Here's the link to what I used:

http://forum.cmsmadesimple.org/index.ph ... 152.0.html

The solution I used is the second one, posted by Nan.

Thanks nicmare for all your help.

Author:  badoul [ Mon Sep 05, 2011 11:55 am ]
Post subject:  Re: Multilevel (3 depth) jQuery Accordion Side Menu

Hi nicmare
i used your solution who works very smoothly.
But now i am observed that when i add a new section (title menu) who has no sub category the page load and close the menu without any effect.
Do you know how can i change this?
And i have one more question.
How can i do to have separate class for each li (or parent). Maybe based on the active title menu.
Like this i can custom each menu. ;D
thanks for any idea


b

Author:  jd447 [ Tue Nov 22, 2011 1:04 pm ]
Post subject:  Re: Multilevel (3 depth) jQuery Accordion Side Menu

badoul \badoul:
Hi nicmare

How can i do to have separate class for each li (or parent). Maybe based on the active title menu.


b


replace the menu template (.tpl) with this one
\$1:
{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}

Author:  jd447 [ Tue Nov 22, 2011 3:08 pm ]
Post subject:  Re: Multilevel (3 depth) jQuery Accordion Side Menu

is there a way to close a menu when it's clicked again?

thanks for your help!

Author:  Festarossa [ Mon Jan 30, 2012 2:10 pm ]
Post subject:  Re: Multilevel (3 depth) jQuery Accordion Side Menu

boby \boby:
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

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.

EDIT: I use the solution provided in the first message of this topic.

Author:  frany [ Tue Aug 27, 2013 3:21 pm ]
Post subject:  Re: Multilevel (3 depth) jQuery Accordion Side Menu

Thank you very much to SigisM and nicmare, this is waht I have been looking for.

Un fortunately the SigisM's menu It doesn't work to me, but nicmare one is working very well.

I hope to come back for learn a load of things.

Thanks.

Kind Regards.

Author:  andre_designer [ Wed Oct 16, 2013 8:39 pm ]
Post subject:  Re: Multilevel (3 depth) jQuery Accordion Side Menu

the first post is nice and its working on its own good. But i /you can't open the page from the parent item. how can i make this work so that i can click/visite all the pages. my jquery knowledge is level newbie. so if anyone can help that should be nice.

Author:  Dr.CSS [ Thu Oct 17, 2013 7:20 pm ]
Post subject:  Re: Multilevel (3 depth) jQuery Accordion Side Menu

We would need to see the problem site to offer any help...

Page 2 of 2 All times are UTC
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/