How to style the value of a custom field?

  • Posts: 62
  • Thank you received: 0
  • Hikashop Business
8 years 7 months ago #254089

-- HikaShop version -- : 2.6.4
-- Joomla version -- : 3.6.4
-- PHP version -- : 5.6.22

Hi,

I have a question about styling the value of a custom field. As you can see on this page, www.winecellar1870.com/en/rarewines , and especially the product 'Chateau Haut Brion 1975', I have a custom field called 'SL'. With CSS I have styled the label. Unfortunately it is not possible to style the value. How can I do this?

[/img]

regards,
Joost

Attachments:

Please Log in or Create an account to join the conversation.

  • Posts: 83995
  • Thank you received: 13605
  • MODERATOR
8 years 7 months ago #254095

Hi,

Normally the label and the value have their own class but it seems that the file "listing_img_title" of the view "product" has been customized on your website via the menu Display>Views and you don't have them.
So you'd have to edit that view file in order to also add a class for the values.

Please Log in or Create an account to join the conversation.

  • Posts: 62
  • Thank you received: 0
  • Hikashop Business
8 years 7 months ago #254124

Hi Nicolas,

Thanks for the quick reply! I have edit the original file and made the necessary modifications. Now I have the class (class="hikashop_product_custom_value") added. But one issues still exists; I want to edit only the value corresponding to the value of the field 'SL'. When I edit the class this is involving all the values of the custom fields. Is it possible to edit only the specific value?

regards,
Joost

Please Log in or Create an account to join the conversation.

  • Posts: 83995
  • Thank you received: 13605
  • MODERATOR
8 years 7 months ago #254141

Hi,

Well, also add the column name of the custom field in the class name of the HTML tag and the class will be different for each custom field.

Please Log in or Create an account to join the conversation.

  • Posts: 62
  • Thank you received: 0
  • Hikashop Business
8 years 7 months ago #254269

Hi Nicolas,

It is not clear to me what you mean. My code with the custom fields looks likes this:



Whan I change 'class="hikashop_product_custom_value"' to "class="hikashop_product_custom_value stocklocation" all the custom fields are influenced. What am I doing wrong?

regards,
Joost

Attachments:

Please Log in or Create an account to join the conversation.

  • Posts: 83995
  • Thank you received: 13605
  • MODERATOR
8 years 7 months ago #254271

Hi,

For example, change:
class="hikashop_product_custom_value"
to:
class="hikashop_product_custom_value_<?php echo $fieldName; ?>"

And you'll be able to use the class hikashop_product_custom_value_XXX where XXX is the column name of the custom field you want to target.

Please Log in or Create an account to join the conversation.

  • Posts: 62
  • Thank you received: 0
  • Hikashop Business
8 years 7 months ago #254317

Hi Nicolas,

Thanks for your quick en understanding response! I got it working!

regards and thanks again,
Joost

Please Log in or Create an account to join the conversation.

Time to create page: 0.074 seconds
Powered by Kunena Forum