MenuManager Bug

Talk about writing modules and plugins for CMS Made Simple, or about specific core functionality. This board is for PHP programmers that are contributing to CMSMS not for site developers
Post Reply
Foaly*
Translator
Translator
Posts: 150
Joined: Sun Mar 29, 2009 3:32 pm
Location: London

MenuManager Bug

Post by Foaly* »

There's a bug in the MenuManager module.. I'm currently searching it, but perhaps someone else already knows where it is.

Structure of my test page:
2 root
2.1 child1
2.1.1 subchild1
2.2 child2

the markup:
{menu childrenof='root'}

the menu template:
<ul>
{foreach from=$nodelist item=node}
<li>{$node->depth} {$node->menutext}</li>
{/foreach}
</ul>

the result:
* 1 child1
* 2 subchild1
* 0 child2
Foaly*
Translator
Translator
Posts: 150
Joined: Sun Mar 29, 2009 3:32 pm
Location: London

Re: MenuManager Bug

Post by Foaly* »

I use this as an ugly work-around:
{assign var="temp" value='.'|explode:$node->hierarchy}
{assign var="depth" value=$temp|@sizeof}
{assign var="depth" value=$depth-1}
uniqu3

Re: MenuManager Bug

Post by uniqu3 »

Cant confirm this behavior used {menu childrenof='some page'} containg two sub pages each with children and my output is:

1.1
1.1.1
1.1.2
1.2
1.2.1
1.2.2

This looks correct to me. Used standard simple_navigation sample template.
Foaly*
Translator
Translator
Posts: 150
Joined: Sun Mar 29, 2009 3:32 pm
Location: London

Re: MenuManager Bug

Post by Foaly* »

Okay, I've also tried it with simple_navigation now.
The instance var hierarchy works quite fine, so does not depth. Please replace hierarchy by depth and test again.
Foaly*
Translator
Translator
Posts: 150
Joined: Sun Mar 29, 2009 3:32 pm
Location: London

Re: MenuManager Bug

Post by Foaly* »

Post Reply

Return to “Developers Discussion”