[Solved] Need some help tweaking my menus/navigation

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
DoctorWho
Forum Members
Forum Members
Posts: 34
Joined: Mon Jan 24, 2011 5:14 pm

[Solved] Need some help tweaking my menus/navigation

Post by DoctorWho »

I don't know if this is post belongs here or in the CSS section; feel free to move it if need be.

I just noticed something on my navigation, that I stuck trying to fix. I using a greater than greater than symbol to indicate that parent link has children. However, when I go to the parent page, the greater than symbol disappears from the menu. Yet the sub menu works just fine.

So my question is, how do I get the greater than symbol to appear when I am on the parent page?

My web site is here, and if you go to Information > Tuition then go back to the Information drop down menu you will notice that the greater than symbol is gone.

Here is my code for my menu:

Code: Select all


{if $count > 0}
<ul id="nav" class="sf-menu">
{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->parent == true or ($node->current == true and $node->haschildren == true)}
<li><a href="{$node->url}" {if $node->target}onclick="target='newwindow'" {/if}>{$node->menutext}</a>

{elseif $node->haschildren == true and $node->depth >= 2}
<li><a href="{$node->url}" {if $node->target}onclick="target='newwindow'" {/if}><span style="float:right;">></span>{$node->menutext}</a>

{elseif $node->haschildren == true and $node->type != 'sectionheader' and $node->type != 'separator'}
<li><a href="{$node->url}" {if $node->target}onclick="target='newwindow'" {/if}>{$node->menutext}</a>

{elseif $node->current == true}
<li><a href="{$node->menutext}">{$node->menutext}</a>

{elseif $node->type == 'sectionheader'}
<li class="sectionheader">{$node->menutext}

{else}
<li><a href="{$node->url}" {if $node->target}onclick="target='newwindow'" {/if}>{$node->menutext}</a>

{/if}

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


Last edited by DoctorWho on Wed Feb 02, 2011 11:36 pm, edited 1 time in total.
User avatar
Dr.CSS
Moderator
Moderator
Posts: 12711
Joined: Thu Mar 09, 2006 5:32 am

Re: Need some help tweaking my menus/navigation

Post by Dr.CSS »

This may be due to a bug in menu manager not using the parent node correctly which is fixed in 1.9.3 to be released very soon...
DoctorWho
Forum Members
Forum Members
Posts: 34
Joined: Mon Jan 24, 2011 5:14 pm

Re: Need some help tweaking my menus/navigation

Post by DoctorWho »

That's great to know, because I am currently using 1.7.1 and I was going to upgrade to 1.9.2 over the weekend. But know that I know that version 1.9.3 is coming soon, I think I'll just wait. Hopefully version 1.9.3 will resolve this issue.

Thanks Dr.CSS!
User avatar
Dr.CSS
Moderator
Moderator
Posts: 12711
Joined: Thu Mar 09, 2006 5:32 am

Re: Need some help tweaking my menus/navigation

Post by Dr.CSS »

If you would have told that you are using 1.7.1 I would have said it should work as it does in my 1.7.1 install, it may have to do with the order in the menu template, some if this do this, need to be in a certain order...
DoctorWho
Forum Members
Forum Members
Posts: 34
Joined: Mon Jan 24, 2011 5:14 pm

Re: Need some help tweaking my menus/navigation

Post by DoctorWho »

Then how would I go about resolving this issue using 1.7.1
DoctorWho
Forum Members
Forum Members
Posts: 34
Joined: Mon Jan 24, 2011 5:14 pm

Re: Need some help tweaking my menus/navigation

Post by DoctorWho »

My deepest apologies for not mentioning that I am using 1.7.1.

Correct me if I am wrong, but I am leaning to believe that all I need is an if statement to check to see if I am on the current page that also happens to be the parent.

I've tried this:

Code: Select all

{elseif $node->current == true and $node->parent == true}
<li><a href="{$node->url}" {if $node->target}onclick="target='newwindow'" {/if}><span style="float:right;">></span>{$node->menutext}</a>
but that doesn't work. I've tried similar if statements (too many to list), but sadly none of them have worked.

I know I am so close to get this resolved, I can feel it.
DoctorWho
Forum Members
Forum Members
Posts: 34
Joined: Mon Jan 24, 2011 5:14 pm

Re: Need some help tweaking my menus/navigation

Post by DoctorWho »

I finally got this issues resolved! I don't know if this is the best way of doing things, but it works and pretty much all I care about.

Code: Select all

{if $node->parent == true or ($node->current == true and $node->haschildren == true)}
<li><a href="{$node->url}" {if $node->target}onclick="target='newwindow'" {/if}> <span style="float:right;">></span>{$node->menutext}</a>
CMSMS: 1.9.4.3 | PHP: 5.2.12 | MySQL: 5.0.45 | Linux
User avatar
Dr.CSS
Moderator
Moderator
Posts: 12711
Joined: Thu Mar 09, 2006 5:32 am

Re: [Solved] Need some help tweaking my menus/navigation

Post by Dr.CSS »

I think if you would have looked in some of the default menu templates in the 1.7.1 ver. you most likely will see something just like that...
Post Reply

Return to “CMSMS Core”