alternate colours in vertical menu bar

Talk about writing modules and plugins for CMS Made Simple, or about specific core functionality. This board is for PHP programmers that are contributing to CMSMS not for site developers
Post Reply
barry cooper
Forum Members
Forum Members
Posts: 63
Joined: Fri Jul 13, 2007 6:49 am

alternate colours in vertical menu bar

Post 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
rmelberg

Re: alternate colours in vertical menu bar

Post 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
User avatar
Dr.CSS
Moderator
Moderator
Posts: 12711
Joined: Thu Mar 09, 2006 5:32 am
Location: Arizona

Re: alternate colours in vertical menu bar

Post by Dr.CSS »

I'm more than sure this has been answered more than once... search is your friend... ;)
Post Reply

Return to “Developers Discussion”