Zen Cart Logo
Forums / Templates, Stylesheets, Page Layout / CSS applied to product listing page in specific categories only

CSS applied to product listing page in specific categories only

Locked

Views: 1,392

Results 1 to 5 of 5
This thread is locked. New replies are disabled.
4 Mar 2008, 12:23 AM
#1
robgt avatar

robgt

New Zenner

Join Date:
Dec 2007
Posts:
27
Plugin Contributions:
0

CSS applied to product listing page in specific categories only

Hi,
Is it possible to load a stylesheet dependent upon the category being viewed.
I need to style the product listing table differently in one area of a site without affecting how those products appear in the normal product listing pages.

I would need one stylesheet for the majority of pages, but some categories and sub-categories need a separate stylesheet loading?

Help or sggestions appreciated!
Cheers,
Rob

4 Mar 2008, 12:42 AM
#2
gjh42 avatar

gjh42

Black Belt

Join Date:
Jul 2005
Location:
Upstate NY
Posts:
21,876
Plugin Contributions:
8

Re: CSS applied to product listing page in specific categories only

Look in /includes/templates/template_default/css/CSS_read_me.txt.

It explains how to use per-category stylesheets.

Note that a stylesheet can only operate on elements with distinct class/id/tag handles, which you may sometimes need to add to the PHP code.

4 Mar 2008, 1:05 AM
#3
robgt avatar

robgt

New Zenner

Join Date:
Dec 2007
Posts:
27
Plugin Contributions:
0

Re: CSS applied to product listing page in specific categories only

Thank you again.
This category dependent stylesheet is directly related to my other question that you have answered. Is there a logical way for me to test for a list of categories/sub-categories and apply the separate stylesheet to those in the same way?

There will be multiple categories, each with multiple sub-categories that this needs to apply to.
Cheers,
Rob

4 Mar 2008, 1:13 AM
#4
gjh42 avatar

gjh42

Black Belt

Join Date:
Jul 2005
Location:
Upstate NY
Posts:
21,876
Plugin Contributions:
8

Re: CSS applied to product listing page in specific categories only

It is possible to apply the stylesheet to a category and its subs, but I don't have that information at hand. It requires modifying one or more PHP files.

The issue has been discussed and methods posted here several months ago, perhaps a year or more. Clydejones was one of the posters involved.

7 Mar 2008, 12:32 AM
#5
robgt avatar

robgt

New Zenner

Join Date:
Dec 2007
Posts:
27
Plugin Contributions:
0

Re: CSS applied to product listing page in specific categories only

This has been resolved now.
In my editing a template over-ride for the product listing page, I've coded in some alternate classes for the specific sub-sections required.

Thanks for all your help!
Cheers,
Rob