If you mean K2 Extra Fields then you can add the name of the field to its class which you can use in css by its fieldname. Such as below example.
In file: templates/gk_bike_store/html/com_k2/templates/default/item.php
Line: 189 you will see following code. This code is single line but for display purposes I have broke it down to few lines.
- Code: Select all
<li class="<?php echo ($key%2) ? "odd" : "even"; ?> type<?php echo ucfirst($extraField->type); ?> group<?php echo $extraField->group; ?>">
<span class="itemExtraFieldsLabel"><?php echo $extraField->name; ?>:</span>
<span class="itemExtraFieldsValue"><?php echo $extraField->value; ?></span>
</li>
You can use fields name as css class such as below span examples.
- Code: Select all
<span class="itemExtraFieldsLabel <?php echo $extraField->name; ?>label"><?php echo $extraField->name; ?>:</span>
<span class="itemExtraFieldsValue <?php echo $extraField->name; ?>value"><?php echo $extraField->value; ?></span>
Lets say following are our extra fields: VIPCharge, UsualCharge
So by above example this would produce following html
- Code: Select all
<span class="itemExtraFieldsLabel VIPChargelabel">VIPCharge:</span>
<span class="itemExtraFieldsValue VIPChargevalue">£100</span>
<span class="itemExtraFieldsLabel UsualChargelabel">UsualCharge:</span>
<span class="itemExtraFieldsValue UsualChargevalue">£50</span>
You can then use following in css.
- Code: Select all
.VIPChargelabel { your css }
.VIPChargevalue { your css }
.UsualChargelabel { your css }
.UsualChargevalue { your css }
See you around...