Drop Down Menu

For discussion and questions related to CMS Specific templates and stylesheets (CSS), and themes. or layout issues. This is not a place for generic "I don't know CSS issues"
Locked
rob8271
New Member
New Member
Posts: 5
Joined: Sat Oct 27, 2018 11:41 am

Drop Down Menu

Post by rob8271 »

I am looking for a way to make our menu produce sub menus. The code for the menu is shown below and is a provided one in Menu Manager.


The code is:


{if $count > 0}
<div id="menuwrapper">
<ul id="primary-nav">
{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
{elseif $node->current == true}
<li><a
{elseif $node->haschildren == true}
<li><a
{elseif $node->type == 'sectionheader'}
<li><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>
{/if}
{/foreach}

{repeat string="</li>" times=$node->depth-1}</li>
</ul>
</div>
{/if}
User avatar
Dr.CSS
Moderator
Moderator
Posts: 12678
Joined: Thu Mar 09, 2006 5:32 am
Location: Arizona

Re: Drop Down Menu

Post by Dr.CSS »

Do you haves pages with children..?

Does the menu tag in the tag in the template say number_of_levels='1'..?

Are you using a drop down menu stylesheet..?

More info = More help
Check ver. CMSMS, PHP, server OS, in System Information page.
Default content http://multiintech.com/defaultcontent/
People are Wonderful
Business is Great
Life is Terrific
Ever wonder what happened to the Album module? Well it is alive and well.
http://album.multiintech.com/
Image
rob8271
New Member
New Member
Posts: 5
Joined: Sat Oct 27, 2018 11:41 am

Re: Drop Down Menu

Post by rob8271 »

Hi. Thanks for your reply. You will have to forgive me if I struggle a bit as I am a beginner at this.

Yes, I have pages with children.

If you mean this part of the template, there is no reference to levels at all.

<div id="menu">
<div class="menu_wrapper">
{menu template='Roundwood-menu' collapse='0'}
</div>

I think the stylsheet is what I am looking for, because the menu is only displaying as a single level menu.
User avatar
velden
Dev Team Member
Dev Team Member
Posts: 3293
Joined: Mon Nov 28, 2011 9:29 am
Location: The Netherlands

Re: Drop Down Menu

Post by velden »

What version of CMSMS are we talking about?
rob8271
New Member
New Member
Posts: 5
Joined: Sat Oct 27, 2018 11:41 am

Re: Drop Down Menu

Post by rob8271 »

it's 1.11.7 "Genovesa"
User avatar
Gregor
Power Poster
Power Poster
Posts: 1872
Joined: Thu Mar 23, 2006 9:25 am
Location: The Netherlands

Re: Drop Down Menu

Post by Gregor »

Better first move to the latest version of cmsms; there is a difference in the approach on how to build a menu between the earlier and the later version of cmsms.
User avatar
PinkElephant
Forum Members
Forum Members
Posts: 154
Joined: Fri Feb 06, 2009 2:08 pm

Re: Drop Down Menu

Post by PinkElephant »

As suggested, definitely upgrade if you can -- do it even if your can't ;). But if you're *really* stuck on 1.* ...

It's hard to believe that 1.11.7 shipped with the template you quoted. It's testing for sub-menu items, etc but doing nothing...

Code: Select all

	{if $node->parent == true or ($node->current == true and $node->haschildren == true)}
		<li><a 
	{elseif $node->current == true}
		<li><a
	{elseif $node->haschildren == true}
		<li><a
	{elseif $node->type == 'sectionheader'}
		<li><span> {$node->menutext} </span>
	{elseif $node->type == 'separator'}
		<li style="list-style-type: none;"> <hr class="separator" />
	{else}
		<li><a
	{/if}
(I can't remeber 1.* too well but there might be an option to 'Reset' the template to factory-default).
Locked

Return to “Layout and Design (CSS & HTML)”