MODxJust thought I would share this nifty little trick I use to pass MODx Template Variables (TVs) into hidden form fields.

If you are familiar with utilizing TVs you know that they are used to assign a variable inside of a MODx template. The developer can also allow the CMS user to assign these values per each content page. It is in this instance that this technique has a high degree of value.

<input type="hidden" value="[*yourTV*]"> 

In the most straightforward instance you can have a contact form within each page assigned a given email address (this can then be passed down the site structure through inheritance or by setting a default TV value). If the CMS user would like to assign an alternate recipient for a page then they simply change the recipient in that specific TV of the page. As I mentioned this could be straightforward and be an email address (I am not recommending placing an email address onto a page) or a value (recipient name) that can then be routed to a particular email address. Either way the CMS user can control where the form is sent.

I am currently using this on an auto dealer site in which they post weekly specials. The customer requires that each car lead may be routed to a different salesman. The best solution was to give the control of this routing to the CMS user.

blog comments powered by Disqus