menu template help ( CMSMS v 1.1 )

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"
Post Reply
davidj
New Member
New Member
Posts: 2
Joined: Fri Dec 19, 2014 2:27 pm

menu template help ( CMSMS v 1.1 )

Post by davidj »

Hi

I have a menu template below...

This template nests <ul> and <li> like this

Code: Select all

<ul class="menu1"><li><ul class="menu2"><li></li><li></li><li></li></ul></li><li><ul class="menu3"><li></li><li></li><li></li></ul></li><li></li></ul>
I would like to change this so the format looks like this

Code: Select all

<ul class="menu1"><li></li><li></li><li></li></ul>
<ul class="menu2"><li></li><li></li><li></li></ul>
<ul class="menu3"><li></li><li></li><li></li></ul>
Can anyone help please?

Code: Select all

{* CSS classes used in this template:
.activeparent - The top level parent when a child is the active/current page
li.active0n h3 - n is the depth/level of the node. To style the active page for each level separately. The active page is not clickable.
.clearfix - Used for the unclickable h3 to use the entire width of the li, just like the anchors. See the Tools stylesheet in the default CMSMS installation.
li.sectionheader h3 - To style section header
li.separator - To style the ruler for the separator *} 

{assign var='number_of_levels' value=10000}
{if isset($menuparams.number_of_levels)}
  {assign var='number_of_levels' value=$menuparams.number_of_levels}
{/if}

{if $count > 0}
<ul>
{foreach from=$nodelist item=node}

{if $node->depth > $node->prevdepth}

{repeat string="<ul>" times=$node->depth-$node->prevdepth}

{elseif $node->index > 0}

</li>

{/if}

{if $node->parent == true or $node->current == true}

  {assign var='classes' value='menuactive'}

  {if $node->parent == true}

    {assign var='classes' value='menuactive menuparent'}

  {/if}

  {if $node->children_exist == true and $node->depth < $number_of_levels}

    {assign var='classes' value=$classes|cat:' parent'}
  {/if}

  <li class="{$classes}">

<a class="{$classes}" href="{$node->url}">
   <span>{$node->menutext}</span>
</a>

{elseif $node->children_exist == true and $node->depth < $number_of_levels and $node->type != 'sectionheader' and $node->type != 'separator'}

<li class="parent"><a class="parent" href="{$node->url}"><span>{$node->menutext}</span></a>

{elseif $node->current == true}
<li class="currentpage"><h3><span>{$node->menutext}</span></h3>

{elseif $node->type == 'sectionheader'}
<li class="sectionheader menuitem{$node->id}"><span>{$node->menutext}</span>

{elseif $node->type == 'separator'}
<li class="separator" style="list-style-type: none;"> <hr />

{else}
<li id="menuitem{$node->id}"><a href="{$node->url}"><span>{$node->menutext}</span></a>

{/if}

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

Re: menu template help ( CMSMS v 1.1 )

Post by Dr.CSS »

You will need to explain in more depth what you are trying to do as the code you 'want' is considered "bad" html, a bunch of empty LI...
Post Reply

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