Page 1 of 2

Problem with $node->parent in CMSMS 1.9.2

Posted: Wed Dec 15, 2010 2:29 pm
by nils73
I was just trying to get two menus running: One at the top of the page (nav-main) and one on the side (nav-sub). I did that before and it was working well. But now it seems that $node->parent only has a value when I have one menu and output the whole tree there.

Actually I ran the whole loop with

Code: Select all

<!-- {$node|print_r} -->
so I had all the array-values in my source-code. But parent is empty all the time.

My hierarchy looks something like this:

1. Holiday [section-header]
1.1. Summer Season [content]
1.1.1. Europe [content]
1.1.2. Africa [content]
1.1.3. America [content]
1.2. Winter Season [content]

So both 1 and 1.x are in one menu (nav-main) and 1.x.x are in a second menu (nav-sub). I use the following menu-calls:

Code: Select all

{menu template='nav-main' number_of_levels='2'}

[some HTML here]

{menu template='nav-sub' number_of_levels='1' start_level='3'}
Any help or hint would be highly appreciated. I think it might be a bug, but I am not sure.

Regards,
Nils

Re: Problem with $node->parent in CMSMS 1.9.2

Posted: Thu Dec 16, 2010 10:40 am
by jens.buettner
I have got the same problem. But even if you choose to display all three menu levels in one template there are issues on the third level. On some items you get the class "menuactive" and on some you don't. And I am using the standard cssmenu.tpl and cleared the cache. It's kind of myterious ...

Like Nils, I would appreciate any help ...

Thanks, Jens

Re: Problem with $node->parent in CMSMS 1.9.2

Posted: Thu Dec 16, 2010 10:53 am
by jens.buettner
Ok. Forget about the issues on the third level of a standard menu. That was a mistake of mine. But still I have got trouble with the splitted menu parents ...

Re: Problem with $node->parent in CMSMS 1.9.2

Posted: Thu Dec 16, 2010 3:59 pm
by Dr.CSS
@nils73

What menu template are you using, it may be that it was changed so that if it had child under it not shown in the menu it wouldn't tag it self as a parent...

Re: Problem with $node->parent in CMSMS 1.9.2

Posted: Fri Dec 17, 2010 2:03 pm
by nils73
I don't think it depends on the template because the parent-value is empty when I cycle through the $node array with foreach. It's there however when I have one single menu. But here's my menu template:

Code: Select all

{if $count > 0}
<ul class="floatbox">
{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->current == true}
<li class="open"><h4><dfn>Aktive Seite ist {$node->hierarchy}: </dfn>{$node->menutext}<span class="hideme">.</span></h4>
{elseif $node->type == 'sectionheader'}
<li><h3><dfn>{if $node->parent == true}Aktiver Bereich ist {/if}{$node->hierarchy}: </dfn>{$node->menutext}<span class="hideme">.</span></h3>
{else}
<li{if $node->parent == true} class="open"{/if}><a href="{$node->url}"{if $node->accesskey != ''} accesskey="{$node->accesskey}"{/if}{if $node->tabindex != ''} tabindex="{$node->tabindex}"{/if}{if $node->titleattribute != ''} title="{$node->titleattribute}"{/if}{if $node->target != ''} target="{$node->target}"{/if}><dfn>{if $node->parent == true}Aktiver Bereich ist {/if}{$node->hierarchy}: </dfn>{$node->menutext}<span class="hideme">.</span></a>
{/if}
{/foreach}
{repeat string="</li></ul>" times=$node->depth-1}</li>
</ul>
{/if}
Sorry, parts of it are in German (within tags).

Regards
Nils

Re: Problem with $node->parent in CMSMS 1.9.2

Posted: Tue Dec 28, 2010 11:16 am
by Sonya

Re: Problem with $node->parent in CMSMS 1.9.2

Posted: Tue Dec 28, 2010 8:42 pm
by nils73
Sonya,

thank you for posting this here. I submitted the bug so I am quite aware. However R193 didn't work for me. Still no value in $node->parent when using separate menus. Seems to be a bigger issue.

Regards
Nils

Re: Problem with $node->parent in CMSMS 1.9.2

Posted: Fri Jan 07, 2011 7:54 am
by darconny
Any working solution so far?

I'm trying to upgrade my site with two menu calls and have problems with list classes on the first level. I also use parameter number_of_levels = '1' so it seems I have the same problem.
Everything works fine on version 1.6.7.

Re: Problem with $node->parent in CMSMS 1.9.2

Posted: Fri Jan 07, 2011 8:54 am
by Dr.CSS
Version 1.9.3 is being worked on and menu manager is one of the first being fixed...

Sorry for any inconvenience...

Re: Problem with $node->parent in CMSMS 1.9.2

Posted: Fri Jan 07, 2011 10:45 am
by Reclus
Thanks for the update DR.CSS, this bug was causing me some grief, I look forward to 1.9.3 :)

Re: Problem with $node->parent in CMSMS 1.9.2

Posted: Sun Jan 09, 2011 10:52 pm
by nils73
Tanks for the update on this. Can't wait for this to be fixed. Hope we see v1.93 soon, since I am running a website with this bug on a live server and would be happy to tell the client it's fixed.

Regards
Nils

Re: Problem with $node->parent in CMSMS 1.9.2

Posted: Wed Jan 12, 2011 11:01 am
by nils73
Good news: Problem has been solved in SVN (197).

Thanks to everyone who helped and especially to those who fixed it!

Regards,
Nils

Re: Problem with $node->parent in CMSMS 1.9.2

Posted: Fri Jan 14, 2011 9:00 am
by darconny
Thanks, but this is not working in my case. I replaced the code in MenuManager.module.php with code SVN 197 but the rendered code looks the same.
There is a huge difference with and without using parameter number_of_levels='1'.

Please take a look, screens are from Firebug as I try to finish my upgrade localy:

{menu template='simple_navigation.tpl' collapse='1'}
Image

{menu template='simple_navigation.tpl' number_of_levels='1' collapse='1'}
Image

So, when not using number_of_levels='1' (first image) the code is like it should be.

Any hints?
Thanks.

Re: Problem with $node->parent in CMSMS 1.9.2

Posted: Fri Jan 14, 2011 9:50 am
by RonnyK
This is fixed in SVN, but more than the mentioned revision is needed. With the upcoming 1.9.3, all these changes will be in.

Ronny

Re: Problem with $node->parent in CMSMS 1.9.2

Posted: Fri Jan 14, 2011 9:58 am
by darconny
Thanks Ronny, I'll wait for 1.9.3. :)

Darko