We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 2191
    • 64 Posts
    Okay I’m stupid. grin

    I’ve never fully unlocked the power of template variables, mostly because I’ve never needed to. But now I’m kinda stuck and would appreciate some help. What I’m trying to do isn’t hard, methinks, but I can’t find any documentation.

    A little explanation on the site. I used an e-commerce type setup (similar to ShopX) with individual product pages and Ditto to bring it all together. But I need various options in each product (e.g. large or small). I can do this by using template variables within each product page I think, but I’m clueless where to start. I’d like the options to be available as a simple form with drop down options.

    I can’t logically think this one through. Do I create a different TV for every option I need? Can I define the different options in each document using TVs? How would it work? Right now I’m only using one TV for price, [*itemprice*].

    Thanks. It’s probably something simple that I’ll shake my head about later. undecided
      • 25663 MODX Staff
      • 12,272 Posts
      I have a shop setup similarly as well. I use a separate TV for price, weight, part number, etc. I use various Input Widgets as needed to build select lists for instance.
        Ryan Thrash, MODX Co-Founder
        Follow me on Twitter at @rthrash or catch my occasional unofficial thoughts at thrash.me
        • 25663 MODX Staff
        • 12,272 Posts
        Wish I had lots of time to do a write up but at the moment I’m a bit swamped. There’s lots of posts on TVs in general, and the documentation/wiki covers them as well. If you’ve got any specific questions I’ll try to get you some answers. Good luck!
          Ryan Thrash, MODX Co-Founder
          Follow me on Twitter at @rthrash or catch my occasional unofficial thoughts at thrash.me
          • 25663 MODX Staff
          • 12,272 Posts
          Using radio buttons would allow you just a few pre-set prices, is that what you want? You’d just create the TV in the format specified in the documentation, and then set the appropriate output widget.
            Ryan Thrash, MODX Co-Founder
            Follow me on Twitter at @rthrash or catch my occasional unofficial thoughts at thrash.me
            • 33372
            • 1,611 Posts
            Try what Ryan says - it works. You can also use a snippet that calls the getTemplateVariableOutput() function to create your form output if you find that easier. But I think that a TV output widget is the fastest and simplest method for radio buttons.
              "Things are not what they appear to be; nor are they otherwise." - Buddha

              "Well, gee, Buddha - that wasn't very helpful..." - ZAP

              Useful MODx links: documentation | wiki | forum guidelines | bugs & requests | info you should include with your post | commercial support options