Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
I wanted to get all of my field labels bold and their data normal, and not all ubercart fields on the product pages allow this. The price labels are all in spans with classes, but dimensions, weight, and SKU/Model are just text strings inside a div. It seemed logical to simply render those fields quite similarly to how the rest of the class="product-info" fields (such as sell price, list price, and cost) display: inside spans with appropriate classes.
Comment | File | Size | Author |
---|---|---|---|
#13 | 1471372-uc_product-markup-13.patch | 4.18 KB | longwave |
#7 | 1471372-uc_product-markup.patch | 1.77 KB | longwave |
#3 | 1471372-product-info-spans-3.patch | 1.7 KB | bancarddata |
#1 | 1471372-product-info-spans.patch | 1.74 KB | bancarddata |
Comments
Comment #1
bancarddata CreditAttribution: bancarddata commentedComment #3
bancarddata CreditAttribution: bancarddata commentedWhoops... the theme functions were moved!
Comment #4
longwaveThe SKU, Weight and Dimensions label strings still need to wrapped in t(), and there is no need to use t() on single strings such as @sku (use check_plain instead) or !weight (use uc_weight_format directly).
Comment #5
TR CreditAttribution: TR commented@bancarddata: You've assigned this issue to yourself - are you still working on this? Can you provide a new patch that addresses the issues raised in #4?
Comment #6
TR CreditAttribution: TR commentedComment #7
longwaveThis patch fixes the above issues and uses consistent classes so e.g. you can make all the labels bold with one CSS rule.
Comment #9
longwave#7: 1471372-uc_product-markup.patch queued for re-testing.
Comment #11
longwave#7: 1471372-uc_product-markup.patch queued for re-testing.
Comment #12
TR CreditAttribution: TR commentedI see that most of the product theme functions accept an argument of $variables['attributes'], which allows additional CSS classes to be attached to the element being output by the theme function. The exceptions are theme_uc_product_model() and theme_uc_product_model(), which don't allow this.
I think *all* the theme functions should do this - it's only a small change. It should also be documented in the function comments - right now we make no mention that 'attributes' is a valid key for the input array.
Because you're already modifying these functions, it would probably be easier to handle the change in this issue rather than open a new one.
Comment #13
longwaveComment #14
longwaveCommitted #13.