Dynamic templates for the form pages
You might have a situation where you need to use the same form a few different ways and you need the landing page for the form to have a different site template for each use.
- The site template that's used to display the form in the lightbox needs to be different from the template to display the form on a regular page.
- The site template that's used to display the landing page in the lightbox needs to be different from the template to display the landing page as a regular page.
Use a different template for the form
When you create the page for the form use a site template to display the form as a regular page. To specify a different site template for the form in the lightbox use the special tid parameter in the URL to the page.
Example: <a href="/form-page?tid=3">View Form</a>
The tid URL parameter tells the system to use the site template that has an ID of 3 instead of the site template that is normally assigned to the page.
Below is an example using jQuery to modify the link tag URL. In this case the form page uses a site template whose ID is 4.
Use a different template for the landing page
To tell the landing page to use a specific template you need to pass through a hidden form field whose name is aptid.
Example: <input type="hidden" name="aptid" value="3" /> .
Below is an example using jQuery to add the hidden form field to the form. In this case both the landing page and the form page use a site template with an ID of 4.
$('form').append('<input type="hidden" name="aptid" value="4" />').attr('action', '/form-page?tid=4');