Page 1 of 1

alternate colours in vertical menu bar

Posted: Mon Sep 03, 2007 1:05 pm
by barry cooper
Hi,

I am trying to the use smarty cycle:

{section name=name loop=$menu}
{$menu[name]}
{/section}

to change the alternate the background color in a vertical nav bar. All achieve something like http://tatteredfly.com/

I am using the following CSS:

div#menu_vert {
  margin:0;
  padding:0;
  color:#333399;
}

div#menu_vert li {
  list-style:none;
  margin-bottom:2px;
  padding:4px 4px 4px 10px;
}

div#menu_vert li.odd {
  background:#33CC99;
}

div#menu_vert li.even {
  background:#009933;
}

I am using the following tag to insert the nav bar info:

{menu template='simple_navigation.tpl' collapse='1'}

My question is what do I have to do to the smarty cycle code to make this work?  I am not sure which bits of the code to alter.

Many Thanks

Barry Cooper

Re: alternate colours in vertical menu bar

Posted: Wed Sep 12, 2007 4:01 pm
by rmelberg
I could be missing something, but it seems like the smarty code should work. Have you tried to render it and see what the output HTML is?

-Rorik

Re: alternate colours in vertical menu bar

Posted: Wed Sep 12, 2007 8:43 pm
by Dr.CSS
I'm more than sure this has been answered more than once... search is your friend... ;)