Page 1 of 1

[SOLVED] Submenu wont display level 2 items?

Posted: Thu Sep 17, 2009 3:25 pm
by deejmer
hi folks....thanks in advance for your help

Running CMSMS v1.6.5, with no extensions
Location of test site: http://gohalo.net/cranberries/index.php ... ct-options
The submenu should be displaying bottom-aligned in the heading image.

I have a main navigation menu, where I have a tag:

Code: Select all

<div id="navigation">
{menu template="cranberries" number_of_levels="1"}
</div>
This works fine...displays as I would expect

Here is the tag that is in my template for my secondary menu:

Code: Select all

<div id="subNavigation">
{menu template="cranberries" number_of_levels="1" start_level="2"}
</div>
If I remove 'start_level="2"', this menu displays fine, but obviously shows the 'parent' items like that in the primary navigation.  If the start_level is set to 2, I'd expect that the level 2 pages should display, but instead nothing displays.

Here is my menu template for 'cranberries':

Code: Select all

{if $count > 0}
<ul class="clearfix">
{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="on"><a href="{$node->url}" {if $node->target ne ""} target="{$node->target}"{/if}> {$node->menutext} </a>

{elseif $node->parent == true && $node->depth == 1}
<li class="on"><a href="{$node->url}" {if $node->target ne ""} target="{$node->target}"{/if}> {$node->menutext} </a>

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

{/if}

{/foreach}

{repeat string="</li></ul>" times=$node->depth-1}</li>
</ul>
{/if}
Here is the applicable CSS for my menu stylings:
primary navigation ->

Code: Select all

#navigation ul {
margin: 0 0 0 265px;
padding: 0;
list-style-type: none;
}
#navigation li {
margin: 0;
padding: 0;
float: left;
text-decoration:none;
border:none;
text-align: left;
font-size:.9em;
font-weight:bold;
margin: 0px 4px 0 4px;
}

#navigation li.on{
text-decoration:none;
border:none;
text-align: left;
background: #376e86;
margin: 0px 1px 0 1px;
}

#navigation li a{
color:#9DD5F3;
text-decoration:none;
border:none;
margin: 4px 8px 0 8px;
height:21px;
display:block;
}

#navigation li a:hover{
color:#fff;
}

#navigation ul li.on a{
color:#fff;
text-decoration:none;
border:none;
margin: 4px 8px 0 8px;
height:21px;
display:block;
}

#navigation li.on a:hover{
color:#9DD5F3;
}
secondary navigation ->

Code: Select all

#subNavigation {
width: 100%;
position:absolute;
top:220px;
left:80px;
}
#subNavigation ul {
margin: 0;
padding: 0;
list-style-type: none;
}
#subNavigation li {
margin: 0;
padding: 3px 0 0 0;
float: left;
}

#subNavigation {
padding: 0;
}

#subNavigation li{
height:25px;
width:141px;
text-decoration:none;
border:none;
background: url(uploads/cranberries/images/tabOff.png) no-repeat;
text-align: left;
font-size:.9em;
font-weight:bold;
}

#subNavigation li.on{
height:25px;
width:141px;
text-decoration:none;
border:none;
background: url(uploads/cranberries/images/tabOn.png) no-repeat;
text-align: left;
}

#subNavigation li a{
color:#fff;
text-decoration:none;
border:none;
margin: 10px 0 0 10px;
}

#subNavigation ul li.on a{
color:#a5233c;
text-decoration:none;
border:none;
margin: 10px 0 0 10px;
}
Attached is a screencapture of my "pages" menu, so you can see that my hierarchy is correct

Thanks so much for looking....hopefully you can help!

Re: Submenu wont display level 2 items?

Posted: Thu Sep 17, 2009 3:26 pm
by RonnyK

[SOLVED] Submenu wont display level 2 items?

Posted: Thu Sep 17, 2009 3:30 pm
by deejmer
Thank you Ronnie!  That did the trick!  I was wondering what I was doing wrong....good to know it was the core code and not me.  ;D