Add class to the Product Detail page to distinguish from Product List page

Permalink
First, eCommerce addon rocks -- bought license last night and well worth it. I've used Drupal and OSCommerce previously and once again, c5 just does it right.

ANNNYYWWAY, I'm trying to create a CSS class to distinguish between a Product Detail page from the Product List page. Both will use ".ccm-core-commerce-add-to-cart" as the class for any product blocks, yet I style them significantly different between either page.

Product List page uses class ".ccm-core-commerce-product-list-results". I need one to identify the product detail page. Any ideas which php page to muck around with?

Thanks!
Gary

ps. I created a table-less version of display.php so I can style product block better...

garyam
 
ideasponge replied on at Permalink Best Answer Reply
ideasponge
you could just use a combination CSS element like ".wrapper .whatever" and then on the pages you want a different look applied, click the block then go to Design -> CSS tab and then adding a your wrapper class name.

You can also put the custom CSS additional CSS box and make it a Preset so you can reuse it easily in other places.

Also make sure that your CSS file is included after the c5 CSS files are. If for some reason their CSS is overriding yours you can use the !important flag (used like key:value!important;).


If the eCommerce block is using inline CSS then you may need to actually create a custom template for that block and make your changes there.

You can do that by copying the view.php file out of the /packages/core_commerce/blocks/core_commerce/the_block_you_want and then copy that into your own /blocks/the_block_you_want/templates DIR and rename it to something like custom_view.php. I just pulled paths from memory so they may not be 100% in what I said but that should be enough to guide you.
garyam replied on at Permalink Reply
garyam
Perfect - the templates did the trick. I couldn't just apply a classname because I am customizing the Page Type defaults so all products will have those class names -- and page type defaults doesn't seem to allow "design" modifications on its blocks. thanks again...