View Full Version : CUSTOMVAR text label
Tarquin
04-Jul-2004, 09:19 AM
I have added a CUSTOMVAR:RATED to Act_ProductLine.html.
What is the syntax to add the corresponding label for the variable?
Mike Hughes
04-Jul-2004, 09:44 AM
First declare the CUSTOMVAR as 'text' in 'advanced>custom properties'
Then go to the properties tag on the product details screen. Click '+' on the top LH corner of the table and a new row will appear. Click on the cell in first column of the row and a drop down list with your declared customvars appears. Select the one you want and then enter the text you want to appear in the next column.
Mike
Tarquin
04-Jul-2004, 10:37 PM
Thanks for the advice Mike but that’s not what I am after.
I have got that far and the page displays this value. But there is no text to explain what the value means.
What I would like to do is display the label too without hard coding this text into Act_ProductLine.html.
The end result I am after is
If value exists display Label and Value
If value is null display nothing - Much like not adding a price for a product. No price is displayed and neither is the Label ‘Price’.
(I hope I am making sense)
Kevin
NormanRouxel
05-Jul-2004, 08:32 AM
You'd need some JavaScript on your Product Template where you want this optional text to display. E.g.
<script language=JavaScript>
<!--
if ( 'CUSTOMVAR:RATED' ) document.write( 'My description ' );
// -->
</script>
CUSTOMVAR:RATED
You can not use the single quote ( ' ) in your CUSTOMVAR:RATED text as this will break the JavaScript.
Norman
Mike Hughes
05-Jul-2004, 08:39 AM
Ok, now I understand.
Customervars work by actinic replacing the customvar with the text. So I don't think what you're after can be done that way.
Some oprions are:
a) Include the label in the text.
b) Use two customvars, one for the label, another for the text.
You could also try using a file which would allow you more formatting control over the displayed text. You could also try calling a file for the first customvar and embedding the text into the file using the second customvar, but I don't know if this would work and you'd still need 2 customervars per label/text combination.
Mike
vBulletin® v3.8.4, Copyright ©2000-2012, Jelsoft Enterprises Ltd.