Follow us on Twitter X-Cart on Facebook Wiki
Shopping cart software Solutions for online shops and malls
 

Different Navigation Images for different Categories

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design
 
Thread Tools Search this Thread
  #1  
Old 06-03-2004, 02:08 PM
 
Beaker Beaker is offline
 

Newbie
  
Join Date: May 2004
Posts: 9
 

Default 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}
Reply With Quote
  #2  
Old 06-08-2004, 12:56 PM
  B00MER's Avatar 
B00MER B00MER is offline
 

X-Guru
  
Join Date: Sep 2002
Location: Keller, TX (Cart-Lab.com)
Posts: 3,165
 

Default

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

Kudos!
__________________
Cart-Lab - 100+ Social Bookmarks for X-Cart.
Reply With Quote
  #3  
Old 06-08-2004, 02:37 PM
 
Beaker Beaker is offline
 

Newbie
  
Join Date: May 2004
Posts: 9
 

Default

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.
Reply With Quote
  #4  
Old 06-08-2004, 02:54 PM
 
Emerson Emerson is offline
 

X-Man
  
Join Date: Mar 2004
Location: Atlanta, GA
Posts: 2,209
 

Default

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.

I like your site design. Very clean and away from the usual x-cart layout.
__________________
Emerson
Total Server Solutions LLC- Quality X-Cart Hosting
Recommended X-Cart Hosting Provider - US and UK servers
Does your host backup your site? We do EVERY HOUR!!!
Shared Hosting | Managed Cloud | Dedicated Servers
Reply With Quote
  #5  
Old 06-29-2004, 12:13 PM
 
deftgroup deftgroup is offline
 

Member
  
Join Date: May 2004
Location: Delray Beach, FL
Posts: 12
 

Default

how exactly did you impliment that... could I see your categories.tpl?
Reply With Quote
  #6  
Old 06-30-2004, 11:30 AM
 
Beaker Beaker is offline
 

Newbie
  
Join Date: May 2004
Posts: 9
 

Default

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>
Reply With Quote
  #7  
Old 07-01-2004, 03:55 PM
 
deftgroup deftgroup is offline
 

Member
  
Join Date: May 2004
Location: Delray Beach, FL
Posts: 12
 

Default

awesome thanks.. I actually just hardcoded mine into the home.tpl becasue I ran outa time..
Reply With Quote
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -8. The time now is 07:30 AM.

   

 
X-Cart forums © 2001-2020