Collapse not working in menu manager (v1.7.6)

For questions and problems with the CMS core. This board is NOT for any 3rd party modules, addons, PHP scripts or anything NOT distributed with the CMS made simple package itself.
Post Reply
joeri
Forum Members
Forum Members
Posts: 11
Joined: Tue Sep 22, 2009 4:38 am

Collapse not working in menu manager (v1.7.6)

Post 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'}
Jos
Support Guru
Support Guru
Posts: 4019
Joined: Wed Sep 05, 2007 8:03 pm
Location: The Netherlands

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

Post 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?
joeri
Forum Members
Forum Members
Posts: 11
Joined: Tue Sep 22, 2009 4:38 am

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

Post 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.
cmaunoury
Forum Members
Forum Members
Posts: 36
Joined: Sun Jul 19, 2009 9:52 pm

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

Post 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!
cmaunoury
Forum Members
Forum Members
Posts: 36
Joined: Sun Jul 19, 2009 9:52 pm

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

Post 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
Post Reply

Return to “CMSMS Core”