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)
-   -   How do you vary the Header via Category? (https://forum.x-cart.com/showthread.php?t=48745)

gb2world 07-25-2009 09:13 AM

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>


Marc Washburn 07-25-2009 11:25 AM

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,

gb2world 07-25-2009 12:15 PM

Re: How do you vary the Header via Category?
 
Be sure and get firebug - it is indispensable for debugging css and html (& javascript).


All times are GMT -8. The time now is 04:38 AM.

Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.