Managing To Address & Name in Foundation Forms with CMS


We have had many people asking how they could manage the To Address and To Name fields from Foundation Forms with the CMS. On the first try, you may want to insert the CMS macros into the settings. However, this will not work.

Foundation Form Settings

Remember that the CMS can only process macros that exist on the actual webpage. These 2 fields in the Foundation forms are stored in an external PHP file that the CMS does not have access to. Small lesson here… if a CMS macro not working (but others are on the page), chances are that it won’t work.

In this situation though, Foundation forms have a small back door that we can exploit to make all of this work. Foundation forms support using data from the actual form to process the form. You simply using this tempting syntax (called Mustache) to insert the value from a form field: Where the value inside the braces is the actual name of the field from the form.

Foundation Form Settings

How does this help us? Well you can add 2 hidden form fields and set their values to be be CMS macros. Then inside the Form Base settings you can use the Mustache templates to reference those to fields inside the address and name fields.

Here is a sample project file setup of the hidden fileds and how you should set them up: http://jwurl.net/1rbyzo6

Now go forth and make your websites great!