X-Cart: shopping cart software

X-Cart forums (https://forum.x-cart.com/index.php)
-   Changing design (https://forum.x-cart.com/forumdisplay.php?f=51)
-   -   Different Navigation Images for different Categories (https://forum.x-cart.com/showthread.php?t=7899)

Beaker 06-03-2004 02:08 PM

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}

B00MER 06-08-2004 12:56 PM

Your code looks good to me, the only change you'll need to make would be instead of $cat use $smarty.get.cat

Kudos!

Beaker 06-08-2004 02:37 PM

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

Emerson 06-08-2004 02:54 PM

Quote:

Originally Posted by Beaker
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


I like your site design. Very clean and away from the usual x-cart layout. 8)

deftgroup 06-29-2004 12:13 PM

how exactly did you impliment that... could I see your categories.tpl?

Beaker 06-30-2004 11:30 AM

Quote:

Originally Posted by deftgroup
how exactly did you impliment that... could I see your categories.tpl?


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>

deftgroup 07-01-2004 03:55 PM

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.