![]() |
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 ! |
Re: Different skin for different categories
You can use an if statement that will load different css file based on current category
|
Re: Different skin for different categories
Thanks, I will try that !
|
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. |
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
|
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} |
Re: Different skin for different categories
Hello Ashley.
In what file I should use this statement? Thank you for your help. |
Re: Different skin for different categories
Quote:
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. |
Re: Different skin for different categories
if else statement was added to skin1/customer/home.tpl
and seems to work fine. |
Re: Different skin for different categories
Quote:
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 |
Re: Different skin for different categories
It goes BEFORE </head>
|
Re: Different skin for different categories
Quote:
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.