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

How do you vary the Header via Category?

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design
 
Thread Tools Search this Thread
  #11  
Old 07-25-2009, 09:13 AM
  gb2world's Avatar 
gb2world gb2world is offline
 

X-Wizard
  
Join Date: May 2006
Location: Austin, TX
Posts: 1,970
 

Default Re: How do you vary the Header via Category?

I think surrounding it with {literal} and {/literal} should keep smarty compiler from trying to figure out the brackets. So, this should compile without smarty errors:


Code:
<style type="text/css"> <!-- {if $current_category.categoryid eq 123} {literal}#header {background: #ffffff url(images/neon_lights/head_bg_123.gif) repeat-x 1px top;}{/literal} {/if} {if $current_category.categoryid eq 456} {literal}#header {background: #ffffff url(images/neon_lights/head_bg_456.gif) repeat-x 1px top;}{/literal} {/if} --> </style>
__________________
X-CART (4.1.9,12/4.2.2-3/4.3.1-2/4.4.1-5)-Gold
(CDSEO, Altered-Cart On Sale, BCSE Preorder Backorder, QuickOrder, X-Payments, BCSE DPM Module)
Reply With Quote
  #12  
Old 07-25-2009, 11:25 AM
 
Marc Washburn Marc Washburn is offline
 

Advanced Member
  
Join Date: May 2004
Posts: 72
 

Wink Re: How do you vary the Header via Category?

gb2world and everyone else...thank you SOOO MUCH!

Got it working via this code:

Code:
<style type="text/css"> {if $current_category.categoryid > 5 and $current_category.categoryid < 8} <!-- {literal} #header .head_wrap {background: transparent url(/skin1/images/neon_lights/head_top_coffee.jpg) left top no-repeat;} #header .line1 {background: transparent url(/skin1/images/neon_lights/head_top_coffee.jpg) left top no-repeat;} #header {background: #ffffff url(/skin1/images/neon_lights/head_bg_coffee.jpg) repeat-x 1px top;} {/literal} --> {/if} {if $current_category.categoryid eq 2 or $current_category.categoryid eq 3 or $current_category.categoryid eq 5 or $current_category.categoryid eq 32 or $current_category.categoryid eq 33} <!-- {literal} #header .head_wrap {background: transparent url(/skin1/images/neon_lights/head_top_bread.jpg) left top no-repeat;} #header .line1 {background: transparent url(/skin1/images/neon_lights/head_top_bread.jpg) left top no-repeat;} #header {background: #ffffff url(/skin1/images/neon_lights/head_bg_bread.jpg) repeat-x 1px top;} {/literal} --> {/if} </style>

Thank you again for everyone's help. I am proud of myself as this is the first time I am coding in Smarty. The last languages I coded in was Pascal and Cobol...

I had a couple of other formatting issues and errors, but using the Firefox Plug in 'Webmaster Tools', I was able to follow the CSS code and see when the variables worked and didn't work.

thanks again,
__________________
Marc Washburn
Natural Bath & Body Shop
P.O. Box 2555
Tarpon Springs, FL 34688
marc@naturalbathandbodyshop.com
www.naturalbathandbodyshop.com

Mod Newbie
X-cart 4.4.5 - Now Live !!! Hurray!
X-cart 4.2.1 - Delicae Gourmet
Reply With Quote
  #13  
Old 07-25-2009, 12:15 PM
  gb2world's Avatar 
gb2world gb2world is offline
 

X-Wizard
  
Join Date: May 2006
Location: Austin, TX
Posts: 1,970
 

Default Re: How do you vary the Header via Category?

Be sure and get firebug - it is indispensable for debugging css and html (& javascript).
__________________
X-CART (4.1.9,12/4.2.2-3/4.3.1-2/4.4.1-5)-Gold
(CDSEO, Altered-Cart On Sale, BCSE Preorder Backorder, QuickOrder, X-Payments, BCSE DPM Module)
Reply With Quote
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 10:13 AM.

   

 
X-Cart forums © 2001-2020