need help with menu collapse issues

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
tonyg
Forum Members
Forum Members
Posts: 80
Joined: Sun Dec 14, 2008 4:54 am

need help with menu collapse issues

Post by tonyg »

Hi,
  My issue is viewable at wwwstage.ultra-fei.com/index.php?page=products-2 .  If you notice the left nav, clicking on 'receivers' (for example) will cause the 'aircraft instruments' to expand even thought it was not the choice.  I would like it to only expand when it has been selected.  How can I do this?

I call the menu this way

Code: Select all

{menu template="FL-LeftNav" start_element="1.2.1" show_root_siblings="1" collapse="1"}
and this is my menu template

Code: Select all

{* CSS classes used in this template:
#menuwrapper - The id for the <div> that the menu is wrapped in. Sets the width, background etc. for the menu.
#primary-nav - The id for the <ul>
.menuparent - The class for each <li> that has children.
.menuactive - The class for each <li> that is active or is a parent (on any level) of a child that is active. *}
{if $count > 0}
<ul>
{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 class="menuactive menuparent"><a class="menuactive menuparent" 
{elseif $node->current == true}
	<li class="menuactive"><a class="menuactive" 
{elseif $node->haschildren == true}
	<li class="menuparent"><a class="menuparent" 
{elseif $node->type == 'sectionheader'}
        <li class="sectionheader"><span> {$node->menutext} </span>
{elseif $node->type == 'separator'}
        <li style="list-style-type: none;"> <hr class="separator" />
{else}
	<li><a 
{/if}
{if $node->type != 'sectionheader' and $node->type != 'separator'}
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 ne ""} target="{$node->target}"{/if}>{$node->menutext}</a>
{elseif $node->type == 'sectionheader'}
><dfn>{$node->hierarchy}: </dfn>{$node->menutext}</a>
{/if}

{/foreach}

	{repeat string="</li></ul>" times=$node->depth-1}		</li>
	</ul>
<div class="clearb"></div>

{/if}
User avatar
tophers
Forum Members
Forum Members
Posts: 218
Joined: Thu Jun 07, 2007 7:25 pm

Re: need help with menu collapse issues

Post by tophers »

Hi Tony,

The odd thing is I have (or had) the exact same problem on one of my test sites. When you selected the second page of a section, it turned on both the second and third pages (in both the drop-down menu and the simple side menu). I ran through the code again, and even replaced the .tpl with one from a similar site that was working, and couldn't seem to shake the problem.

So I tried this - I went to Pages > Reorder Pages, and moved some of the subsections around. Problem gone! And when I put everything back in the same order, my site looked the way I wanted it to, and the bug was gone.

I can't explain it. It wasn't the .tpl swap, because on comparison they were exactly the same. If someone reading this can explain the bug, please do - I'd love to know what was going on! But until then, give the above a try and let me know if it worked.
tonyg
Forum Members
Forum Members
Posts: 80
Joined: Sun Dec 14, 2008 4:54 am

Re: need help with menu collapse issues

Post by tonyg »

Chris,
  Thanks for the tip, but it did not work.  Anyone else seen this issue?

thanks
Post Reply

Return to “CMSMS Core”