I am converting a site that consists of a bunch of php files into CMS Made Simple 2.0.1.1. There is a page for each staff person in the organization, and each page has a link like this:
<a href="contact.php?id=unique-id-for-this-person">Contact Me</a>
So, a bunch of similar links point to a single form that manages emailing the particular person. How can I duplicate this functionality?
I saw a similar question on the Forum where the issue had to do with passing a parameter to the {FormBuilder} call, but this is a bit different since the parameter there is passed inside CMS instead of from a URL as in my case.
Can someone give a suggestion as to the correct "CMSMS way" to do what I need to do?
Thanks,
Matt
How to send parameter to a FormBuilder page
Re: How to send parameter to a FormBuilder page
Usually one would use a module (like e.g. LISE) to create the 'pages' for every person.
(Not very relevant per se)
The GET parameter you supply in the url ('id') can be used inside cmsms:
You can also use CGSimpleSmarty module and its module_action_url method (read help)
However, be sure to test if the specific parameter CAN be used to supply a value to FormBuilder first. Not every field definition type can handle it.
Further you might want to test if the url doesn't disclose too much information regarding the supplied parameters (email-adres).
Finally, always take some security precautions when using 'user input' (the url parameters).
(Not very relevant per se)
The GET parameter you supply in the url ('id') can be used inside cmsms:
Code: Select all
{$smarty.get.id}
You can then create a link to a FormBuilder form with unique parameters per person 'page'.{module_action_url}
A smarty plugin that can create a url to a module action.
Arguments:
module - The module to create a link to. This argument is optional, the system will attempt to detect the current module name (if within a module action)
action (default) - The action to call within the module
page - Specify the destination page
jsfriendly|forjs - Turns on the urlonly parameter, and indicates that javascript friendly urls are output.
forajax - Turns on the jsfriendly parameter (and the urlonly parameter), and also appends showtemplate=false to the URL output for AJAX requests
assign - Assign the output of the plugin to the named smarty variable.
Any other arguments to the smarty plugin will be added to the URL generated.
Example:
{module_action_url module='News' action='fesubmit' assign='foo'}
However, be sure to test if the specific parameter CAN be used to supply a value to FormBuilder first. Not every field definition type can handle it.
Further you might want to test if the url doesn't disclose too much information regarding the supplied parameters (email-adres).
Finally, always take some security precautions when using 'user input' (the url parameters).