Forums / Templates, Stylesheets, Page Layout / What to name the CSS files for Product pages?

What to name the CSS files for Product pages?

Views: 2,047

Results 1 to 11 of 11
9 Jan 2012, 9:12 PM
#1
thebigkick avatar

thebigkick

New Zenner

Join Date:
Jan 2012
Location:
Montreal
Posts:
84
Plugin Contributions:
0

What to name the CSS files for Product pages?

I read the wiki and (forgive me) I'm stilll confused as to how to name my css files.

I targeted each Category page on my site by naming the css files accordingly (c_1.css, c_2.css etc). Now I'm trying to target the product pages.

I've tried p_[category path].css but nothing is happening.

Thanks

9 Jan 2012, 10:01 PM
#2
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
176

Re: What to name the CSS files for Product pages?

p_##.css

where ## is the products_id value from the URL when you look at that product page on your site

It's explained in your /includes/templates/template_default/css/CSS_read_me.txt file amongst other places

.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole

Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

9 Jan 2012, 10:04 PM
#3
thebigkick avatar

thebigkick

New Zenner

Join Date:
Jan 2012
Location:
Montreal
Posts:
84
Plugin Contributions:
0

Re: What to name the CSS files for Product pages?

Here is an example url of my product page:

hxxp://my_stupid_website.com/index.php?main_page=product_info&cPath=40_18&products_id=813

I'm thinking of naming the product page CSS file either product_info.css or p_40.css.

Thing is I want this to have an affect on all of my product pages located under the Categories and Subcategories.

10 Jan 2012, 2:36 PM
#5
thebigkick avatar

thebigkick

New Zenner

Join Date:
Jan 2012
Location:
Montreal
Posts:
84
Plugin Contributions:
0

Re: What to name the CSS files for Product pages?

gjh42:

If you want to target all product info pages, name your custom stylesheet product_info.css.

Thank you. I read all the documentation in the wiki. I don't know why I didn't come accross that.

10 Jan 2012, 4:10 PM
#6
gjh42 avatar

gjh42

Black Belt

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

Re: What to name the CSS files for Product pages?

Probably because it isn't spelled out in so many words for this particular case. The CSSreadme.txt in the /classic/css/ folder talks about stylesheets for "page names", and product_info is a page name... for all individual product pages.

10 Jan 2012, 4:12 PM
#7
thebigkick avatar

thebigkick

New Zenner

Join Date:
Jan 2012
Location:
Montreal
Posts:
84
Plugin Contributions:
0

Re: What to name the CSS files for Product pages?

One more thing. To edit the order by which items show up on the product page I can edit tpl_product_info_display.php? I want to move the Add to Cart button to the top inline with the product's price.

Thanks

10 Jan 2012, 4:15 PM
#8
gjh42 avatar

gjh42

Black Belt

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

Re: What to name the CSS files for Product pages?

That's right. Move code blocks to an appropriate output order, then fine-tune the display in your stylesheet.

Remember that a floated element (as the add to cart will likely be) can only rise to the bottom of the preceding non-floated element. If you want it inline with the prices and the prices are not floated, it needs to come before the price block in the output.

10 Jan 2012, 4:15 PM
#9
thebigkick avatar

thebigkick

New Zenner

Join Date:
Jan 2012
Location:
Montreal
Posts:
84
Plugin Contributions:
0

Re: What to name the CSS files for Product pages?

Nevermind got it. My assumption was right.

Sorry for the pollution

10 Jan 2012, 4:29 PM
#10
thebigkick avatar

thebigkick

New Zenner

Join Date:
Jan 2012
Location:
Montreal
Posts:
84
Plugin Contributions:
0

Re: What to name the CSS files for Product pages?

gjh42:

Remember that a floated element (as the add to cart will likely be) can only rise to the bottom of the preceding non-floated element. If you want it inline with the prices and the prices are not floated, it needs to come before the price block in the output.

Yup, I floated the price element left, reduced the width from 100% to 150px. Floated the button right and it slid right up.