![]() |
Re: Load different style sheets for main categories
This seeems to work -
{if strpos($smarty.server.REQUEST_URI, "SWCHS") !== false} <p>SWCHS image/CSS</p> {else} default image/css {/if} Needs proper testing but seems like a possible simple solution. Where and in what template is this needed to load override CSS? many thanks for your help. Much appreciated. |
Re: Load different style sheets for main categories
No sweat, glad to help.
Look in: /common_files/customer/service_css.tpl - or your custom skin directory instead of common_files. Look a how it calls in the altskin near the bottom: PHP Code:
|
Re: Load different style sheets for main categories
Thanks.
My simple solution is fine until you get to product page. The category name is then not present in the URL. Plan B? Keith |
Re: Load different style sheets for main categories
I have just realised I can manually add the correct category name to the Clean URL.
It might just solve my problems. No doubt your coded solution would be more elegant? Can you see any real problem with my approach here? Thanks |
Re: Load different style sheets for main categories
I tell you what, I think the category name not being present represents an SEO problem. But that's just my opinion. I don't see a problem, if the solution works, than it works.
Coding the solution in PHP would be more elegant and consistent, without worrying about changing url's around. Another solution to this issue that just occurred to me, is to put a select box on category and product pages, "theme" and then just set the proper themes based on the contents of that box. You could even do it with extra fields....maybe. |
Re: Load different style sheets for main categories
Not to get "dreamy" here, but it is a shame this is sooo hard in XC. I have had a LC store running for 6 yrs and this functionality, to define different layouts for the subcategory, product list, and product details and to decide whether a particular subcat would inherit from above in the hierarchy, etc. has been built in as far back as I can remember.
I feel you pain in wanting this functionality back as I move towards XC 4.5.0 |
Re: Load different style sheets for main categories
Quote:
PHP Code:
|
Re: Load different style sheets for main categories
Thanks cherie.
I will have 6 main categories, 2 main sub cats in those and 20 or so categories in each of the 2 sub cats so quite a few to add to array. Also if client added a category it would need adding to code. Is there a way of testing for the main category only so that all sub and sub sub cats inherit the style and logo? |
Re: Load different style sheets for main categories
I use this on product or category pages to get the top category id of the current location:
PHP Code:
|
Re: Load different style sheets for main categories
Elegant and simple solution Cherie! Thanks
|
All times are GMT -8. The time now is 03:27 AM. |
Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.