1 Form Generator Plugin
The form generator plugin configuration must contain a list of all Mesh projects
, that should have the plugin enabled, and an apiKey
:
projects: - "Project_1" - "Project_2" apiKey: "this-is-a-secret-api-key"
2 Custom Proxy
Configuration of a Custom Proxy is necessary, because in a normal deployment, the Mesh instance will not be accessible directly from the users’ browsers.
Instead, requests to the form generator plugin will be directed to the custom proxy URL of the CMS, which will forward the requests to Mesh.
The configuration of the custom proxy must contain the same projects and apiKey (as FG-ACCESSTOKEN) as the form generator plugin configuration.
$MESH_BASEURL = "http://[meshhost]:[meshport]/api/v2/"; $MESH_PROJECTS = array("Project_1", "Project_2"); $FG_ACCESSTOKEN = "this-is-a-secret-api-key"; $CUSTOM_PROXY["fg"] = array( "baseUrl" => $MESH_BASEURL . "{{meshProject}}/plugins/fg/", "methods" => array( "GET", "POST", "DELETE" ), "permission" => array( "type" => 90001, "id" => 1 ), "headers" => array( "FG-ACCESSTOKEN" => $FG_ACCESSTOKEN ), "parameters" => array( "meshProject" => array( "default" => $MESH_PROJECTS[0], "values" => $MESH_PROJECTS ) ) );
3 Custom Tool
The Form Generator Tool must be configured as Custom Tool to allow users access to the UI.
The id and key must be unique for all configured custom tools.
$CUSTOM_TOOLS[] = array( "id" => 1, "key" => "formgenerator", "toolUrl" => '/tools/form-generator/?sid=${SID}', "iconUrl" => "list_alt", "name" => array( "de" => "Formulargenerator", "en" => "Form Generator" ), "newtab" => false );
4 Download URLs
To correctly generate download URLs in form data exports, the external CMS URL must be configured by setting CN_EXTERNAL_SERVER
accordingly.
$CN_EXTERNAL_SERVER = 'https://cms.domain.com';
5 Tagtype
The tagtype used to include a form into a page must include a part of type “Form”, which will let the editor select a form. The part will store and render the UUID of the selected form, which can be used to render the necessary markup for rendering the form in the implementation.
It is best practice to restrict the tagtype to the nodes, which can have forms (which should be exactly the nodes for which the respective Mesh project names are configured in the form generator plugin and the custom proxy).
6 CMS Nodes
All Nodes, which can have forms must have the feature New Tag Editor activated, because selecting forms with the Form PartType will not work with the old Tagfill dialog.