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 skin for different categories (https://forum.x-cart.com/showthread.php?t=50748)

the_island 11-15-2009 01:14 AM

Different skin for different categories
 
Hi there,

a client of mine, would like his shop to have a different look when a user is browsing "Men's categories" and a different look for another category.

Is this something doable and how can I make it work ?

Thanks !

cflsystems 11-15-2009 05:26 AM

Re: Different skin for different categories
 
You can use an if statement that will load different css file based on current category

the_island 11-17-2009 12:44 AM

Re: Different skin for different categories
 
Thanks, I will try that !

Yalokin 12-23-2009 11:55 AM

Re: Different skin for different categories
 
I tryed:

{if $current_category.categoryid eq "Name of categories1"}
<link href="{$SkinDir}/main.css" rel="stylesheet" type="text/css" />
{elseif $current_category.categoryid eq "Name of categories1"}
<link href="{$SkinDir}/mainORIGINAL.css" rel="stylesheet" type="text/css" />
{else}
<link href="{$SkinDir}/main.css" rel="stylesheet" type="text/css" />
{/if}

did not work.
also tried name of style sheet.


{if $current_category.categoryid eq "Name of categories1"}
{$SkinDir}/main.css
{elseif $current_category.categoryid eq "Name of categories2"}
mainORIGINAL.css
{else}
main.css
{/if}


Added to skin1/customer/home.tpl
Maybe location is wrong maybe syntax?
Maybe I need to ad categories ID instead of Name of categories?

Any advise?

Thank you.

cflsystems 12-23-2009 06:12 PM

Re: Different skin for different categories
 
categoryid is a number not a text. You can open a cat in admin for editing and look at the url - it will say categoryid=xxx, thats the categoryid number

ARW VISIONS 12-23-2009 11:12 PM

Re: Different skin for different categories
 
if you click on the category in the admin section and the look at the URL it will show you teh cat id.

so {if $main and $cat eq '255'}
this
{esle}
that
{/if}

Yalokin 01-08-2010 05:16 AM

Re: Different skin for different categories
 
Hello Ashley.


In what file I should use this statement?

Thank you for your help.

Yalokin 01-13-2010 09:55 AM

Re: Different skin for different categories
 
Quote:

Originally Posted by the_island
Hi there,

a client of mine, would like his shop to have a different look when a user is browsing "Men's categories" and a different look for another category.

Is this something doable and how can I make it work ?

Thanks !


I posted working if elseif statement and it might solve your problem.

Still need to figure out how to apply same style to all main categories and child subcategories and it's pruducts without repeating else if over and over.

read this:http://forum.x-cart.com/showthread.php?p=277733#post277733

thank you.

Yalokin 01-13-2010 09:59 AM

Re: Different skin for different categories
 
if else statement was added to skin1/customer/home.tpl

and seems to work fine.

KingPimp 04-03-2010 06:40 AM

Re: Different skin for different categories
 
Quote:

Originally Posted by Yalokin
if else statement was added to skin1/customer/home.tpl

and seems to work fine.


Hi,
firstly thanks for the post, i was half way though attempting this... well i say half way i knew i need an {if} statement just wasnt to sure on how to implement it

i have done it now but have 2 small issues

i have placed my code

{if $main and $cat eq '8'}
<link href="{$SkinDir}/main1.css" rel="stylesheet" type="text/css" />
{else}
<link href="{$SkinDir}/main.css" rel="stylesheet" type="text/css" />
{/if}

in home.tpl just after </head> and it seems to be working fine however i just wanted to know is this the correct positon to place the code as when i am using the flyout menus option.... the menus won't align properly, the triangle icon overlaps the catagory text
i have adjusted things in the flyout menus.css and can move the triangle icon around a bit but can not seem to get things to align as they should
i just wondered if anyone else has had the same problem and solved it or any advice incase there is something i have overlooked or maybe the code is not in the correct place in home.tpl (i have tried it in various loacations)

thanks in advance

cflsystems 04-03-2010 08:51 AM

Re: Different skin for different categories
 
It goes BEFORE </head>

KingPimp 04-04-2010 02:02 AM

Re: Different skin for different categories
 
Quote:

Originally Posted by cflsystems
It goes BEFORE </head>


Cheers Steve.... I did have it there in the first place but tried it in several places to try and correct the problem.... i have now put the if statement in the correct place though so at least thats off the list, think ill have to dig a bit deeper with the flyout menus files over the weekend and see what might be contradicting the code


All times are GMT -8. The time now is 02:46 PM.

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