Problem with $node->parent in CMSMS 1.9.2

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.
nils73
Power Poster
Power Poster
Posts: 520
Joined: Wed Sep 08, 2004 3:32 pm

Problem with $node->parent in CMSMS 1.9.2

Post 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
jens.buettner
New Member
New Member
Posts: 6
Joined: Mon Aug 07, 2006 8:06 pm

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

Post 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
jens.buettner
New Member
New Member
Posts: 6
Joined: Mon Aug 07, 2006 8:06 pm

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

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

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

Post 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...
nils73
Power Poster
Power Poster
Posts: 520
Joined: Wed Sep 08, 2004 3:32 pm

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

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

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

Post by Sonya »

Last edited by Sonya on Tue Dec 28, 2010 11:21 am, edited 1 time in total.
nils73
Power Poster
Power Poster
Posts: 520
Joined: Wed Sep 08, 2004 3:32 pm

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

Post 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
darconny
Forum Members
Forum Members
Posts: 104
Joined: Thu Nov 22, 2007 12:43 pm

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

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

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

Post 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...
Reclus
Forum Members
Forum Members
Posts: 16
Joined: Fri Dec 01, 2006 11:42 pm
Location: London

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

Post by Reclus »

Thanks for the update DR.CSS, this bug was causing me some grief, I look forward to 1.9.3 :)
nils73
Power Poster
Power Poster
Posts: 520
Joined: Wed Sep 08, 2004 3:32 pm

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

Post 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
nils73
Power Poster
Power Poster
Posts: 520
Joined: Wed Sep 08, 2004 3:32 pm

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

Post 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
darconny
Forum Members
Forum Members
Posts: 104
Joined: Thu Nov 22, 2007 12:43 pm

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

Post 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.
RonnyK
Support Guru
Support Guru
Posts: 4962
Joined: Wed Oct 25, 2006 8:29 pm
Location: Raalte, the Netherlands

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

Post 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
darconny
Forum Members
Forum Members
Posts: 104
Joined: Thu Nov 22, 2007 12:43 pm

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

Post by darconny »

Thanks Ronny, I'll wait for 1.9.3. :)

Darko
Post Reply

Return to “CMSMS Core”