![]() |
Different Navigation Images for different Categories
I'm trying to figure out how to write the code that will allow an navigation image to change according to what Category you are currently browsing.
The code would then be placed into the head.tpl Here's what I was thinking even though I don't know the correct way to write it. {if $cat eq "1"} [img]button_1.gif[/img] {elseif $cat eq "2"} [img]button_2.gif[/img] {elseif $cat eq "2"} [img]button_3.gif[/img] {elseif $cat eq "2"} [img]button_4.gif[/img] {else} [img]button_main.gif[/img] {/if} |
Your code looks good to me, the only change you'll need to make would be instead of $cat use $smarty.get.cat
Kudos! |
Sweet...
If you were in the same room I would hug you. http://www.johannajewelry.com A few more bugs to work out and this lady will be very happy. Your site has a whole slew of mods that may work out well in here. :D |
Quote:
I like your site design. Very clean and away from the usual x-cart layout. 8) |
how exactly did you impliment that... could I see your categories.tpl?
|
Quote:
Actually I utilized the head.tpl for that part since I wanted the buttons on every page. this is the final code for the table that holds the buttons. It is pretty big because of the rollover script being used. I just copied all the cells into each if/else statement and replaced the "on" state accordingly. <table width="400" border="0" cellspacing="0" cellpadding="0" height="29"> <tr> {if $smarty.get.cat eq "1"} <td width="66" height="29">[img]/buttons/home_off.gif[/img]</td> <td height="29" width="77">[img]/buttons/necklaces_on.gif[/img]</td> <td height="29" width="67">[img]/buttons/earrings_off.gif[/img]</td> <td height="29" width="73">[img]/buttons/bracelets_off.gif[/img]</td> <td height="29" width="*">[img]/photos/holiday.gif[/img]</td> {elseif $smarty.get.cat eq "2"} <td width="66" height="29">[img]/buttons/home_off.gif[/img]</td> <td height="29" width="77">[img]/buttons/necklaces_off.gif[/img]</td> <td height="29" width="67">[img]/buttons/earrings_on.gif[/img]</td> <td height="29" width="73">[img]/buttons/bracelets_off.gif[/img]</td> <td height="29" width="*">[img]/photos/holiday.gif[/img]</td> {elseif $smarty.get.cat eq "3"} <td width="66" height="29">[img]/buttons/home_off.gif[/img]</td> <td height="29" width="77">[img]/buttons/necklaces_off.gif[/img]</td> <td height="29" width="67">[img]/buttons/earrings_off.gif[/img]</td> <td height="29" width="73">[img]/buttons/bracelets_on.gif[/img]</td> <td height="29" width="*">[img]/photos/holiday.gif[/img]</td> {elseif $smarty.get.cat eq "4"} <td width="66" height="29">[img]/buttons/home_off.gif[/img]</td> <td height="29" width="77">[img]/buttons/necklaces_off.gif[/img]</td> <td height="29" width="67">[img]/buttons/earrings_off.gif[/img]</td> <td height="29" width="73">[img]/buttons/bracelets_off.gif[/img]</td> <td height="29" width="*">[img]/photos/holiday_on.gif[/img]</td> {else} <td width="66" height="29">[img]/buttons/home_on.gif[/img]</td> <td height="29" width="77">[img]/buttons/necklaces_off.gif[/img]</td> <td height="29" width="67">[img]/buttons/earrings_off.gif[/img]</td> <td height="29" width="73">[img]/buttons/bracelets_off.gif[/img]</td> <td height="29" width="*">[img]/photos/holiday.gif[/img]</td> {/if} </tr> </table> |
awesome thanks.. I actually just hardcoded mine into the home.tpl becasue I ran outa time..
|
All times are GMT -8. The time now is 10:52 PM. |
Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.