You will have to do some if statements in smarty. In this situation it would be best to use Menu Manager.
You can take some inspiration for your menu template from here:
http://forum.cmsmadesimple.org/index.ph ... .html - Be sure to read the attached forum thread that he got his idea from.
This person is using the page image field to specify which image to use for the menu item. I am going to do it a little different for you.
If you are working in Menu Manager you can do something like this:
Code: Select all
<ul id="menu">
{foreach from=$nodelist item=node}
<ul id="{$node->alias}">
<img src="/uploads/images/menu/{$node->alias}{if $node->alias = $page_alias}_active{/if}.jpg" alt="{$node->menutext}" /></ul>
{/foreach}
</ul>
This template assumes the following:
1.)You have all of your menu images stored in /uploads/images/menu
2.)Your images are named identically to the page alias of the page it represents.
3.)Your active pages images have _active at the back of it.
Ex.) Your normal image is
www.domain.com/uploads/images/menu/home.jpg and the active page image is
www.domain.com/uploads/images/home_active.jpg
If all else fails, use a bigger hammer.
M@rtijn wrote:
This is a community. This means that we work together and have the same goal (a beautiful CMS), not that we try to put people down and make their (voluntary) job as difficult as can be.