Multilevel (3 depth) jQuery Accordion Side Menu

Do something cool with CMS? Show us ...
This board is for 'Answers', and the discussion of answers... Not for questions.
nicmare
Power Poster
Power Poster
Posts: 1150
Joined: Sat Aug 25, 2007 9:55 am
Location: Berlin

Re: Multilevel (3 depth) jQuery Accordion Side Menu

Post by nicmare »

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
concentre
New Member
New Member
Posts: 8
Joined: Tue Dec 21, 2010 4:55 am

Re: Multilevel (3 depth) jQuery Accordion Side Menu

Post by concentre »

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.
Last edited by concentre on Wed Dec 29, 2010 3:01 pm, edited 1 time in total.
badoul
New Member
New Member
Posts: 5
Joined: Sun Sep 04, 2011 3:59 pm

Re: Multilevel (3 depth) jQuery Accordion Side Menu

Post by badoul »

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
User avatar
jd447
Forum Members
Forum Members
Posts: 134
Joined: Wed Jun 20, 2007 7:06 am
Location: geneva

Re: Multilevel (3 depth) jQuery Accordion Side Menu

Post by jd447 »

badoul wrote: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

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}
User avatar
jd447
Forum Members
Forum Members
Posts: 134
Joined: Wed Jun 20, 2007 7:06 am
Location: geneva

Re: Multilevel (3 depth) jQuery Accordion Side Menu

Post by jd447 »

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

thanks for your help!
Festarossa
New Member
New Member
Posts: 7
Joined: Mon Apr 05, 2010 6:18 pm

Re: Multilevel (3 depth) jQuery Accordion Side Menu

Post by Festarossa »

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
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.
frany

Re: Multilevel (3 depth) jQuery Accordion Side Menu

Post by frany »

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.
andre_designer
Forum Members
Forum Members
Posts: 233
Joined: Sat Apr 10, 2010 4:26 am
Location: Gorinchem

Re: Multilevel (3 depth) jQuery Accordion Side Menu

Post by andre_designer »

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.
User avatar
Dr.CSS
Moderator
Moderator
Posts: 12709
Joined: Thu Mar 09, 2006 5:32 am
Location: Arizona

Re: Multilevel (3 depth) jQuery Accordion Side Menu

Post by Dr.CSS »

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

Return to “Tips and Tricks”