Page 1 of 1

changing colors for odd and even navigation elements

Posted: Thu Aug 23, 2007 12:57 pm
by bazcoop
Hi all,

I want to create a nav bar similar to http://tatteredfly.com/ left nav.  which used:

CSS;

ul.nav {
margin:0;
padding:0;
color:#333399;
}

ul.nav li {
list-style:none;
margin-bottom:2px;
padding:4px 4px 4px 10px;
}

ul.nav li.odd {
background:#33CC99;
}

ul.nav li.even {
background:#009933;
}

and HTML


    one
    two
    three
    four
    five


But i need to automate this using menu manager.

Any ideas.

Thanks

Barry Cooper

Re: changing colors for odd and even navigation elements

Posted: Thu Aug 23, 2007 1:10 pm
by bterkuile
The smarty cycle command should work. This example is with random names, but should give a hint

Code: Select all

{section name=name loop=$menu}
<li class="{cycle values="even,odd"}"> {$menu[name]}</li>
{/section}

Re: changing colors for odd and even navigation elements

Posted: Sun Sep 02, 2007 6:15 pm
by barry cooper
Thanks for the help

I have been working on a different project for a while...

Regards

Barry Cooper