Add additional project
mosparo enables you to define multiple independent projects, each with its own settings, rules, and style that can be used across multiple websites or forms. Before these projects can be selected by editors in TYPO3, they need to be configured.
See also
For more details on mosparo projects, see the official documentation: https://documentation.mosparo.io/docs/usage/projects
Add projects to site set settings (TYPO3 v13 and above)
To configure custom projects in the site settings, perform the following steps.
-
Create an additional site set in your provider extension.
EXT:site_package/Configuration/Sets/ExtendMospraoForm/config.yamlname: exapmle/extendMosparo label: Extend mosparo project list
Copied!See also
-
Now add a settings.definitions.yaml file to define additional projects in the Site settings editor.
EXT:site_package/Configuration/Sets/ExtendMospraoForm/settings.definitions.yamlcategories: mosparoForm: label: 'Form mosparo' mosparoForm.projects: label: 'Projects' parent: mosparoForm mosparoForm.projects.EXAMPLE: label: 'EXAMPLE' parent: mosparoForm.projects settings: plugin.tx_mosparoform.settings.projects.EXAMPLE.publicServer: type: string default: '' category: mosparoForm.projects.EXAMPLE label: 'Public server' description: 'Host of your mosparo installation, which is used in the frontend' plugin.tx_mosparoform.settings.projects.EXAMPLE.verifyServer: type: string default: '' category: mosparoForm.projects.EXAMPLE label: 'Verify Server' description: 'Host of your mosparo installation, which is used at the backend verification' plugin.tx_mosparoform.settings.projects.EXAMPLE.uuid: type: string default: '' category: mosparoForm.projects.EXAMPLE label: 'UUID' description: 'Unique identification number of the project in mosparo' plugin.tx_mosparoform.settings.projects.EXAMPLE.publicKey: type: string default: '' category: mosparoForm.projects.EXAMPLE label: 'Public key' description: 'Public key of the project in mosparo' plugin.tx_mosparoform.settings.projects.EXAMPLE.privateKey: type: string default: '' category: mosparoForm.projects.EXAMPLE label: 'Private key' description: 'Private key of the project in mosparo'
Copied!Note
Replace "EXAMPLE" with a descriptive name that clearly indicates which project you're configuring. This name will be used as the identifier when selecting the project.
- Now add the new set as “dependencies” to your base site set. The same way as for Include static TypoScript via site set (TYPO3 v13 and above).
- Clear the TYPO3 cache through the 'Maintenance' module Admin Tools > Maintenance > Flush TYPO3 and PHP Cache > Flush cache to apply the changes.
- Go to Site Management > Settings in the TYPO3 backend, choose a site and enter the values for the newly created project configuration fields.
- The additional project is now set up and can be referenced by its name using the "selectedProject"-option.
See also
To add the new project to the dropdown in the Form Framework Editor, see: Add projects to the mosparo element in the Form Framework editor
Add projects via TypoScript
To add an additional project, you only need to include the following in your setup.
file:
plugin.tx_mosparoform.settings.projects.EXAMPLE {
publicServer=
verifyServer=
uuid=
publicKey=
privateKey=
}
Note
Replace "EXAMPLE" with a descriptive name that clearly indicates which project you're configuring. This name will be used as the identifier when selecting the project.
Add projects to TypoScript Constants Editor
You can also configure it to appear in the backend Submodule "Constant Editor". To do so, add the following configuration to your constants.
file:
# customsubcategory=02_EXAMPLE=EXAMPLE project settings
plugin.tx_mosparoform.settings.projects.EXAMPLE {
# cat=Form mosparo/02_EXAMPLE/EXAMPLE/10; type=string; label=Host of your mosparo installation, which is used in the frontend
publicServer=
# cat=Form mosparo/02_EXAMPLE/EXAMPLE/20; type=string; label=Host of your mosparo installation, which is used at the backend verification
verifyServer=
# cat=Form mosparo/02_EXAMPLE/EXAMPLE/30; type=string; label=Unique identification number of the project in mosparo
uuid=
# cat=Form mosparo/02_EXAMPLE/EXAMPLE/40; type=string; label=Public key of the project in mosparo
publicKey=
# cat=Form mosparo/02_EXAMPLE/EXAMPLE/50; type=string; label=Private key of the project in mosparo
privateKey=
}
and then in the setup.
, we need to set the following:
plugin.tx_mosparoform.settings.projects.EXAMPLE {
publicServer={$plugin.tx_mosparoform.settings.projects.EXAMPLE.publicServer}
verifyServer={$plugin.tx_mosparoform.settings.projects.EXAMPLE.verifyServer}
uuid={$plugin.tx_mosparoform.settings.projects.EXAMPLE.uuid}
publicKey={$plugin.tx_mosparoform.settings.projects.EXAMPLE.publicKey}
privateKey={$plugin.tx_mosparoform.settings.projects.EXAMPLE.privateKey}
}
Note
Replace "EXAMPLE" with a descriptive name that clearly indicates which project you're configuring. This name will be used as the identifier when selecting the project.
Add projects to the mosparo element in the Form Framework editor
Editors can select from a list of projects in the mosparo form element's select box. To expand this list, do the following:
-
Create a new Form Framework configuration file in your provider extension at
Configuration/
.Yaml/ Extend Mosparo Captcha Form Field. yaml EXT:site_package/Configuration/Yaml/ExtendMosparoCaptchaFormField.yamlprototypes: standard: formElementsDefinition: MosparoCaptcha: formEditor: editors: 300: selectOptions: 20: value: 'EXAMPLE' label: 'EXAMPLE' 30: value: 'EXAMPLE_2' label: 'EXAMPLE_2' ...
Copied!Note
Replace all "EXAMPLE" with a name/identifer of the project you previously added.You can add multiple options just count the 20 up and suplicate the content. -
Register your Form Framework configuration by adding the following to your
ext_
file in your provider extension:localconf. php EXT:site_package/ext_localconf.php\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addTypoScriptSetup( trim( ' module.tx_form { settings { yamlConfigurations { 1916293528 = EXT:EXAMPLE/Configuration/Yaml/ExtendMosparoCaptchaFormField.yaml } } } ' ) );
Copied!Note
Replace "EXAMPLE" with the name of your provider extension.Also, make sure to change the number beforehand to avoid overriding any existing configuration. - Clear the TYPO3 cache through the 'Maintenance' module Admin Tools > Maintenance > Flush TYPO3 and PHP Cache > Flush cache to apply the changes.