We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 47666
    • 43 Posts
    Can you have a template variable with the option to select a chunk? I'm creating a series of landing pages where some pages have a different form than the others. I thought this sounded like a time to use a template variable, but I'm not sure if I can do that.

    Basically I would want to store 3 forms (lets say form-a, form-b, form-c) as chunks, then when I create a new resource select which form to use with that resource.

    Alternatively, I could create seperate templates for each form, but that doesn't seem right since the only thing changing is the form, plus I'd have to change multiple templates for each small change to landing page.

    This question has been answered by sottwell. See the first response.

    • discuss.answer
      • 28042 ☆ A M B ☆
      • 24,524 Posts
      Yes, that is one of the most common uses of TVs. Use a radio button or a checkbox input type.
      a==Form A||b==Form B||c==Form C

      I probably have the order of the value==prompt backwards, I usually do.

      See this ancient page. Scroll down to the "Using Checkboxes to Control Sidebar Content Blocks" section. This was written for Evolution, so the MODX tags will be different. Otherwise, the TV still works the same way.
        Studying MODX in the desert - http://sottwell.com
        Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
        Join the Slack Community - http://modx.org