Page 1 of 1

[SOLVED] Submenu disapearing on click?

Posted: Sun Aug 31, 2008 9:01 am
by actionslax
I am using menumanger module to control horizontal main nav and have a child menu as my sub. Everything looks good. When I click one of said child items the submenu then disappears. I am sure i have missed something but can't figure this out.

Anyone got any ideas?

http://www.select.uk.com/index.php

Cheers in advance

slax

Re: Submenu disapearing on click?

Posted: Sun Aug 31, 2008 9:08 am
by Dr.CSS
You need to provide more info, same template for all sub pages?, what the menu tag looks like?, etc...

Re: Submenu disapearing on click?

Posted: Sun Aug 31, 2008 10:06 am
by actionslax
ah ye, sorry, still asleep.

Master master - currently only home page
Pages master - currently used for all other pages

Link from pages master to Main nav - {menu template='SPMNav2' number_of_levels='1' }
Link from pages master to Sub nav -  {cms_module module='menumanager' collapse='1' template='SPMSubNav1'}

Master Nav -

Code: Select all

{if $count > 0}
<div class="globalNav">
<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"><a 
{elseif $node->current == true}
	<li class="menuactive"><a {elseif $node->haschildren == true}
	<li><a {elseif $node->type == 'sectionheader'}
        <li><span> {$node->menutext} </span>
{elseif $node->type == 'separator'}
        <li class="navDivider">
      </li>
{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'}
>{$node->menutext}</a>
{/if}

{/foreach}

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

Code: Select all

{assign var="depth" value="-2"}
{assign var="depthcheck" value="0"}
{if $count > 0}
{foreach from=$nodelist item=node}
{if $node->index == 0}
{assign var="icon" value="house"}
{elseif $node->haschildren == true }
{assign var="icon" value="folder"}
{elseif $node->haschildren == false }
{assign var="icon" value="page"}
{/if}
{if $depthcheck == 1 && $node->depth != $node->prevdepth}
<div class="subNav">
  <ul>
    {assign var="depth" value=$node->depth}
    {assign var="depthcheck" value="0"}
    {assign var="listopened" value="1"}
    {/if}
    {if $node->depth == $depth}
    <li> <a href="{$node->url}"{if $node->target ne ""} target="{$node->target}"{/if}>{$node->menutext}</a> {$node->titleattribute}</li>
    {/if}
    {if $node->current == true &&  $node->haschildren == true}
    {assign var="depthcheck" value="1"}
    {/if}
    {/foreach}
    {if $listopened == 1}
  </ul>
</div>
{/if}
{/if 
I am sure there is stuff in both of the nav code sections that i don't use but everything works apart from the disapearing sub menu when you click one of its items.

Cheers

Re: Submenu disapearing on click?

Posted: Sun Aug 31, 2008 2:00 pm
by Dr.CSS
I wasn't talking about the menu templates but the page template, most times the have in the top menu {menu template='SPMNav2' number_of_levels='1' }...

And the next menu on the side...  {menu template='nameoftemplate' start_level="2" } so that it shows the second level of the link in top menu that has been clicked...

If you have read all the default pages you should have come across this one explaining the menu and how to use it the way want...

http://multiintech.com/cmsmsdemo/index. ... e=top_left

Re: Submenu disapearing on click?

Posted: Mon Sep 01, 2008 12:36 pm
by actionslax
cool I'll give it a shot.

that link you sent does not display correctly in FF IE etc?

Re: Submenu disapearing on click?

Posted: Mon Sep 01, 2008 9:34 pm
by actionslax
ye i tried that and still not working.

anyone else know why my submenu menu disapears from the markup when a child (submenu) is clicked on?

this would be 3rd level deep.

cheers in advance.

slax

Re: Submenu disapearing on click?

Posted: Wed Sep 03, 2008 6:00 am
by Dr.CSS
Please show the code for the template used for the page Not the menu...

Re: Submenu disapearing on click?

Posted: Wed Sep 03, 2008 4:52 pm
by actionslax
pages master - Main nav - {menu template='SPMNav2' number_of_levels='1' }
pages master - Sub nav -  {cms_module module='menumanager' collapse='1' template='SPMSubNav1'}

the other code is just standard xhtml, these 2 modules are wrapped in div with a relative class.

any ideas?

Re: Submenu disapearing on click?

Posted: Thu Sep 04, 2008 8:52 pm
by Dr.CSS
Try...

pages master - Sub nav -  {cms_module module='menumanager' start_level="2" collapse='1' template='SPMSubNav1'}

(optional) start_level="2" - This option will have the menu only display items starting a the given level. An easy example would be if you had one menu on the page with number_of_levels='1'. Then as a second menu, you have start_level='2'. Now, your second menu will show items based on what is selected in the first menu.

(optional) collapse="1" - Turn on (set to 1) to have the menu hide items not related to the current selected page.

Re: Submenu disapearing on click?

Posted: Sun Sep 07, 2008 8:18 am
by actionslax
Hi Mark,

Cheers for all your help but can't seem to get this working. When I add in the start_level="2" the submenu disappears altogether.

I tried setting up another template to almost to try and trick the page but even that doesn't work.

I am going to have to start afresh with this to see if the menu code is out of sink or something or not unless you have anything else I should try?

cheers

slax

Re: Submenu disapearing on click?

Posted: Mon Sep 08, 2008 9:17 am
by Dr.CSS
After looking at the second menu template I see what the problem is, just use a copy of the main menu and change the id/class of the div/ul and you should be good to go, you don't need all that stuff in the second menu just tell the menu to start at second level in tag...

[SOLVED]Re: Submenu disapearing on click?

Posted: Mon Sep 08, 2008 8:24 pm
by actionslax
Mark that worked! Cheers again for all your help!

Just got to add in the on state..

slax