Announcement

Collapse
No announcement yet.

CUSTOMVAR text label

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    CUSTOMVAR text label

    I have added a CUSTOMVAR:RATED to Act_ProductLine.html.

    What is the syntax to add the corresponding label for the variable?
    Kevin

    Kewley Consultants Ltd

    #2
    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
    -----------------------------------------

    First Tackle - Fly Fishing and Game Angling

    -----------------------------------------

    Comment


      #3
      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
      Kevin

      Kewley Consultants Ltd

      Comment


        #4
        You'd need some JavaScript on your Product Template where you want this optional text to display. E.g.

        Code:
        <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
        Norman - www.drillpine.biz
        Edinburgh, U K / Bitez, Turkey

        Comment


          #5
          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
          -----------------------------------------

          First Tackle - Fly Fishing and Game Angling

          -----------------------------------------

          Comment

          Working...
          X