We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 40088
    • 708 Posts
    I may very well be overthinking this or overlooking the obvious (or both), but I would appreciate any insights or suggestions.

    I have several “Bio” pages which use a single template. Each of these pages will have a structurally identical contact form, the only difference being that each form submission is sent to a different email address. Creating a Chunk for the actual form is straightforward as is the Snippet call ... normally. But that's the catch, I need to define a different ‘&emailTo’ for each Bio page, but if I'm using a single template for all the pages how can I modify the ‘&emailTo’ based on the page that gets loaded? Is such a thing even possible?

    Now I know the obvious way to do this would be to use a separate template (and therefore a separate Snippet call) for each bio. Problem solved. But it seems silly to create multiple (nearly) identical templates simply for the sake of one line of a Snippet call. Certainly there must be a clever MODX way to do this?

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

      Todd
    • discuss.answer
      • 28042 ☆ A M B ☆
      • 24,524 Posts
      Sure. Use a TV for the emailto property value. &emailto=`[[*emailto]]`
        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