Page 1 of 1

[Solved] Need some help tweaking my menus/navigation

Posted: Fri Jan 28, 2011 4:31 pm
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}



Re: Need some help tweaking my menus/navigation

Posted: Fri Jan 28, 2011 6:47 pm
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...

Re: Need some help tweaking my menus/navigation

Posted: Fri Jan 28, 2011 7:49 pm
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!

Re: Need some help tweaking my menus/navigation

Posted: Sat Jan 29, 2011 10:50 pm
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...

Re: Need some help tweaking my menus/navigation

Posted: Mon Jan 31, 2011 8:00 pm
by DoctorWho
Then how would I go about resolving this issue using 1.7.1

Re: Need some help tweaking my menus/navigation

Posted: Wed Feb 02, 2011 6:30 am
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.

Re: Need some help tweaking my menus/navigation

Posted: Wed Feb 02, 2011 11:35 pm
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>

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

Posted: Thu Feb 03, 2011 2:15 am
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...