Page 1 of 1

Collapse not working in menu manager (v1.7.6)

Posted: Wed May 18, 2011 8:33 pm
by joeri
I am trying to show all the children of a certain parent, which does works with the param: childrenof='page_alias'

However, when using that param, the collapse=1, seem to be ignored by the manager. Is this correct behavior or am I missing something here, or just doing something wrong?

Pleace advice...

eg.

Code: Select all

{menu template='navigation' childrenof='main' number_of_levels='3' collapse='1'}

Re: Collapse not working in menu manager (v1.7.6)

Posted: Thu May 19, 2011 10:48 am
by Jos
(optional) collapse="1" - Turn on (set to 1) to have the menu hide items not related to the current selected page.
With the childrenof parameter you limited the menu to only the childs of a certain page, so I guess each of those pages are related to that page. What is it that collapse should do in your opinion?

Re: Collapse not working in menu manager (v1.7.6)

Posted: Thu May 19, 2011 11:00 am
by joeri
Good point, they are indeed all related.

I was expecting this behavior, taking the following structure.

structure:

Code: Select all

mainmenu
- level_2a
-- level_3a
- level_2b
--level_3b
Now, I thought with childrenof = 'mainmenu' and collapse would show:

Code: Select all

- level2a 
- level2b
And when selecting level2a it would show:

Code: Select all

- level_2a
-- level_3a
- level_2b
Anyways, worked around it, so got it working now. Just thought this would be the behavior.

Re: Collapse not working in menu manager (v1.7.6)

Posted: Tue May 31, 2011 4:56 pm
by cmaunoury
Hi,

Can I ask you how you achieved this? I am trying to setup a 3-level menu (of which the first level is required for the MleCMS module structure) and I would like the third level to be displayed only when parents (level 2) are clicked.

only thing is that the MleCMS also requires the childrenof option to be used.

here is what I am working on, I am now using a Jquery accordion menu, but I would prefer something more simple and on which the level 2 also has active links:

http://dvp.colinmaunoury.com

Thanks a lot!

Re: Collapse not working in menu manager (v1.7.6)

Posted: Tue Jun 07, 2011 2:46 pm
by cmaunoury
For anyone interested, I have finally solved this, in a not very dynamic way.
In my case, I wanted to display the categories of my blog entries as a submenu.

I thus excluded my blog page from the menu in the page manager, and modified my menu template like this:

Code: Select all

(...)

{/foreach}
{repeat string="</li></ul>" times=$node->depth-1}</li>

<!-- addition -->

<li>{cms_selflink page="blog_en"}
    {if $friendly_position >= "1.5"}
        {CGBlog action="browsecat"}
    {/if}    
</li>

<!-- end addition -->

</ul>
{/if}
As you can guess, my blog page is located at the friendly position 1.5 of my page structure. So, it works, the limitation is that I have to modify the code if I move and/or add pages and I have to have my blog page at the bottom of my menu.

I had to tweak this a little bit so as to include my three languages architecture, but it is beyond the scope of the original post I guess (anyways pretty simple, it justs involves one more level of {If} with lang_parent in addition to friendly_position.

hope it can be of some help. If anyone has a more dynamic solution, I'd be happy to hear it.

Cheers,

Colin