We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 8454
    • 55 Posts
    I have a TV, [*colors*], with multiple input option values: red==http://the/link/index.php?id=62&color=red || blue==http://the/link/index.php?id=62&color=blue || white==http://the/link/index.php?id=62&color=white etc.
    I am using the Hyperlink widget in the TV.

    How would I get the input labels (i.e. red, blue, white etc) to be output in the frontend page as clickable texts pointing to its corresponding link?
    (or any workaround...)
      • 8454
      • 55 Posts
      OK, so I started the thread yesterday, at half past eleven p.m. This morning I had an answer. Worked right away. What a forum.

      GaneshXL, ABSOLUTELY BRILLIANT! Thank you so much for your valuable help!

      @other-newbies-like-me:
      If you want multiple values of some sort, e.g. different t-shirt colors available, to be associated with a document (page) for that t-shirt in the form of (readable) clickable links:
      1. Create a document for the t-shirt. (Left hand document tree in default installation manager)
      2. Under Resources/Manage resources/Templates, create a template for the front end design of the document. Use the template for the document.
      3. Under Resources/Manage resources/Template Variables (TV) create a TV. Variable name: [*colors*], Caption: Colors, Input Type: Check box. -Input Option Values: red==[~[*id*]~]&color=red || blue==[~[*id*]~]&color=blue || white==[~[*id*]~]&color=white etc (the "==" means: LabelToBeShownWhenEditing==ActualValueSavedToDatabase), Widget: delimited list. Delimiter: ,
      4. Under Template Access (still in the TV) be sure to check the Template you created at 2. Save the TV.
      5. Under Resources/Manage resources/Snippets, create a snippet, name it whatever you want, e.g. [[getColors]]. Copy and paste ganeshXL:s code into the Snippet code (php) field. Save it.
      6. Go to edit the t-shirt document. There should be an entry under Template Variables called Colors. Check applicable colors.
      7. In the document content, or in the Template, put the following call: [!getColors!] where you want a list of clickable color labels to be output linking to their URL.
      The links in the above example will add an "&color=red" to the current page URL when red is clicked. You could use that for conditional switching of product images for example.