Hi again,
I am trying to 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
changing colors for odd and even navigation elements
-
- Forum Members
- Posts: 63
- Joined: Fri Jul 13, 2007 6:49 am
Re: changing colors for odd and even navigation elements
You might want to check that menu template simple_navigation.tpl and look for code
change it
Maybe that is the place you are looking for...
Br, K
Code: Select all
{else}
<li><a href="{$node->url}"
Code: Select all
{else}
<li class="{cycle values="even,odd"}"><a href="{$node->url}"
Br, K
-
- Forum Members
- Posts: 63
- Joined: Fri Jul 13, 2007 6:49 am
Re: changing colors for odd and even navigation elements
Is there a way of modifying the menu manager code and saving under the same name.
Thanks
Baz C
Thanks
Baz C
Re: changing colors for odd and even navigation elements
Barry,
I don't think that that works, as you are now working with the .tpl version. That one is the file-version. When you press the import-button on that menu, you can import it to the DB and give it a name. I think it is good to give it another name as well, as you'll know it's changed from the standard. After giving it a name, you have to change the calling in the template, changing to the new name, AND WITHOUT .tpl, as it is a DB-template.
Ronny
I don't think that that works, as you are now working with the .tpl version. That one is the file-version. When you press the import-button on that menu, you can import it to the DB and give it a name. I think it is good to give it another name as well, as you'll know it's changed from the standard. After giving it a name, you have to change the calling in the template, changing to the new name, AND WITHOUT .tpl, as it is a DB-template.
Ronny
-
- Forum Members
- Posts: 63
- Joined: Fri Jul 13, 2007 6:49 am
Re: changing colors for odd and even navigation elements (SOLVED)
This is the best Forum ever.
MANY MANY THANKS!!!
Regards
Barry Cooper
MANY MANY THANKS!!!
Regards
Barry Cooper
-
- Support Guru
- Posts: 8169
- Joined: Tue Oct 19, 2004 6:44 pm
Re: changing colors for odd and even navigation elements
Please refrain from dual posting.
Follow me on twitter
Please post system information from "Extensions >> System Information" (there is a bbcode option) on all posts asking for assistance.
--------------------
If you can't bother explaining your problem well, you shouldn't expect much in the way of assistance.
Please post system information from "Extensions >> System Information" (there is a bbcode option) on all posts asking for assistance.
--------------------
If you can't bother explaining your problem well, you shouldn't expect much in the way of assistance.