Page 1 of 1

Drop Down Menu

Posted: Sat Oct 27, 2018 4:18 pm
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}

Re: Drop Down Menu

Posted: Sat Oct 27, 2018 11:21 pm
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

Re: Drop Down Menu

Posted: Sun Oct 28, 2018 9:29 am
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.

Re: Drop Down Menu

Posted: Thu Nov 01, 2018 9:46 pm
by velden
What version of CMSMS are we talking about?

Re: Drop Down Menu

Posted: Thu Nov 01, 2018 10:01 pm
by rob8271
it's 1.11.7 "Genovesa"

Re: Drop Down Menu

Posted: Fri Nov 02, 2018 6:52 am
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.

Re: Drop Down Menu

Posted: Fri Nov 02, 2018 11:07 am
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).