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

Different skin for different categories

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design
 
Thread Tools Search this Thread
  #1  
Old 11-15-2009, 01:14 AM
  the_island's Avatar 
the_island the_island is offline
 

Member
  
Join Date: Sep 2006
Location: The dark side of the moon
Posts: 24
 

Default 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 !
__________________
Carpe Diem
Reply With Quote
  #2  
Old 11-15-2009, 05:26 AM
  cflsystems's Avatar 
cflsystems cflsystems is offline
 

Veteran
  
Join Date: Apr 2007
Posts: 14,201
 

Default Re: Different skin for different categories

You can use an if statement that will load different css file based on current category
__________________
Steve Stoyanov
CFLSystems.com
Web Development
Reply With Quote
  #3  
Old 11-17-2009, 12:44 AM
  the_island's Avatar 
the_island the_island is offline
 

Member
  
Join Date: Sep 2006
Location: The dark side of the moon
Posts: 24
 

Default Re: Different skin for different categories

Thanks, I will try that !
__________________
Carpe Diem
Reply With Quote
  #4  
Old 12-23-2009, 11:55 AM
  Yalokin's Avatar 
Yalokin Yalokin is offline
 

Advanced Member
  
Join Date: Sep 2009
Location: New York USA
Posts: 75
 

Default 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.
__________________
Reply With Quote
  #5  
Old 12-23-2009, 06:12 PM
  cflsystems's Avatar 
cflsystems cflsystems is offline
 

Veteran
  
Join Date: Apr 2007
Posts: 14,201
 

Default 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
__________________
Steve Stoyanov
CFLSystems.com
Web Development
Reply With Quote
  #6  
Old 12-23-2009, 11:12 PM
  ARW VISIONS's Avatar 
ARW VISIONS ARW VISIONS is offline
 

X-Man
  
Join Date: Jan 2007
Location: Pensacola, FL
Posts: 2,536
 

Default 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}
__________________
xcart 5.1.2
Reply With Quote
  #7  
Old 01-08-2010, 05:16 AM
  Yalokin's Avatar 
Yalokin Yalokin is offline
 

Advanced Member
  
Join Date: Sep 2009
Location: New York USA
Posts: 75
 

Default Re: Different skin for different categories

Hello Ashley.


In what file I should use this statement?

Thank you for your help.
__________________
Reply With Quote
  #8  
Old 01-13-2010, 09:55 AM
  Yalokin's Avatar 
Yalokin Yalokin is offline
 

Advanced Member
  
Join Date: Sep 2009
Location: New York USA
Posts: 75
 

Default 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.
__________________
Reply With Quote
  #9  
Old 01-13-2010, 09:59 AM
  Yalokin's Avatar 
Yalokin Yalokin is offline
 

Advanced Member
  
Join Date: Sep 2009
Location: New York USA
Posts: 75
 

Default Re: Different skin for different categories

if else statement was added to skin1/customer/home.tpl

and seems to work fine.
__________________
Reply With Quote
  #10  
Old 04-03-2010, 06:40 AM
  KingPimp's Avatar 
KingPimp KingPimp is offline
 

Member
  
Join Date: Mar 2010
Posts: 11
 

Default 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
__________________
X-cart v4.3.1
X-cart v4.4.3

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 02:33 PM.

   

 
X-Cart forums © 2001-2020