Closed (fixed)
Project:
Ubercart
Version:
7.x-3.x-dev
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
21 Feb 2012 at 21:21 UTC
Updated:
8 Mar 2012 at 19:30 UTC
Jump to comment: Most recent file
Comments
Comment #1
tr commentedHmm, pickaxe doesn't show me any results for 'node-type-product' anywhere in the Ubercart source code history. Specifically when in the past was this working for you? Perhaps you had a custom template for the product class that added this?
Comment #2
OldAccount commentedHow does the "node-type-product" class get added to regular products?
Unfortunately I can't remember the last time it was working, but I specifically recall being appreciative of it because we have about 15 product classes and I was glad I wouldn't have to add them all to the CSS, I could just use "node-type-product".
I am using a custom product template (node--product.tpl.php) and it's still being picked up by the product class items, it's just the CSS body class that isn't.
Comment #3
longwavetemplate_preprocess_html() in core has the following code:
I guess we could add another preprocess function to add another body class for Ubercart products; I'd prefer not to reuse node-type-product but a separate class so themers can target the actual "product" type, or all products.
Comment #4
tr commentedProduct classes use node--product.tpl.php because Ubercart implements uc_product_preprocess_node() to allow this. But if you ever do define a node--myclass.tpl.php for a "myclass" product type, this more specific template will take precedence.
Comment #5
longwaveRepurposed this as a feature request. The attached patch adds a "uc-product-node" class to the body tag of all product node pages, including a test to prove this.
Comment #6
longwaveCommitted #5
Comment #7
OldAccount commentedPerfect, thanks so much!
Comment #8
tr commentedIf this worked "in the past" then you must have had some custom code to do it - #5 is a pure D7 solution, and is not something that was ever implemented in Ubercart.