[TASK] Add more info about custom finishers to docs 02/57702/5
authorSusanne Moog <susanne.moog@typo3.org>
Fri, 27 Jul 2018 14:52:32 +0000 (16:52 +0200)
committerChristian Kuhn <lolli@schwarzbu.ch>
Mon, 3 Sep 2018 09:59:30 +0000 (11:59 +0200)
Resolves: #86103
Releases: master
Change-Id: I485ba2eb933734220381a66256d337ab9f3997ec
Reviewed-on: https://review.typo3.org/57702
Reviewed-by: Anja Leichsenring <aleichsenring@ab-softlab.de>
Tested-by: Anja Leichsenring <aleichsenring@ab-softlab.de>
Tested-by: TYPO3com <no-reply@typo3.com>
Reviewed-by: Christian Kuhn <lolli@schwarzbu.ch>
Tested-by: Christian Kuhn <lolli@schwarzbu.ch>
typo3/sysext/form/Documentation/Concepts/Finishers/Index.rst
typo3/sysext/form/Documentation/Concepts/FormEditor/Index.rst
typo3/sysext/form/Documentation/Concepts/FrontendRendering/Index.rst
typo3/sysext/form/Documentation/FAQ/Index.rst

index 68c23f7..a466813 100644 (file)
@@ -79,3 +79,12 @@ SaveToDatabase finisher
 
 The 'SaveToDatabase finisher' saves the data of a submitted form into a
 database table.
+
+.. _concepts-finishers-writecustomfinisher:
+
+Write a custom finisher
+-----------------------
+
+:ref:`Learn how to create a custom finisher here.<concepts-frontendrendering-codecomponents-customfinisherimplementations>`
+
+If you want to make the finisher configurable in the backend UI read :ref:`here<concepts-formeditor-extending-custom-finisher>`.
index 97a2a23..086b781 100644 (file)
@@ -538,3 +538,95 @@ as an array in the default configuration. To load your own translation files,
 you should define an array containing 'EXT:form/Resources/Private/Language/Database.xlf'
 as first entry (key ``10``) followed by your own file (key ``20``) as
 displayed in the example above.
+
+
+.. _concepts-formeditor-extending:
+
+Examples for extending the editor
+---------------------------------
+
+
+.. _concepts-formeditor-extending-custom-finisher:
+
+Adding inspector options for a custom finisher
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+After adding a custom finisher as described :ref:`here <concepts-frontendrendering-codecomponents-customfinisherimplementations>`
+you can also add the finisher to the form editor GUI to let your backend users configure it visually. Add the following
+to the backend yaml setup:
+
+.. code-block:: yaml
+
+   TYPO3:
+      CMS:
+       Form:
+         prototypes:
+           standard:
+             formElementsDefinition:
+               Form:
+                 formEditor:
+                   editors:
+                     900:
+                       # Extend finisher drop down
+                       selectOptions:
+                         35:
+                           value: 'CustomFinisher'
+                           label: 'Custom Finisher'
+                   propertyCollections:
+                     finishers:
+                        # add finisher fields
+                        25:
+                           identifier: 'CustomFinisher'
+                           editors:
+                              __inheritances:
+                                 10: 'TYPO3.CMS.Form.mixins.formElementMixins.BaseCollectionEditorsMixin'
+                              100:
+                                label: "Custom Finisher"
+                              # custom field (input, required)
+                              110:
+                                identifier: 'customField'
+                                templateName: 'Inspector-TextEditor'
+                                label: 'Custom Field'
+                                propertyPath: 'options.customField'
+                                propertyValidators:
+                                  10: 'NotEmpty'
+                              # email field
+                              120:
+                                identifier: 'email'
+                                templateName: 'Inspector-TextEditor'
+                                label: 'Subscribers email'
+                                propertyPath: 'options.email'
+                                enableFormelementSelectionButton: true
+                                propertyValidators:
+                                  10: 'NotEmpty'
+                                  20: 'FormElementIdentifierWithinCurlyBracesInclusive'
+
+                finishersDefinition:
+                  CustomFinisher:
+                    formEditor:
+                      iconIdentifier: 'form-finisher'
+                      label: 'Custom Finisher'
+                      predefinedDefaults:
+                        options:
+                          customField: ''
+                          email: ''
+                    # displayed when overriding finisher settings
+                    FormEngine:
+                      label: 'Custom Finisher'
+                      elements:
+                        customField:
+                          label: 'Custom Field'
+                          config:
+                            type: 'text'
+                        email:
+                          label: 'Subscribers email'
+                          config:
+                            type: 'text'
+
+Make sure the setup file is registered in the backend:
+
+.. code-block:: typoscript
+
+   module.tx_form.settings.yamlConfigurations {
+      123456789 = EXT:yourExtension/Configuration/Form/Backend.yml
+   }
index 15646b4..5d9af92 100644 (file)
@@ -529,6 +529,12 @@ in any other finisher.
        options:
          someOtherCustomOption: '{Custom.unique.value.identifier}'
 
+Add finisher to backend UI
+''''''''''''''''''''''''''
+
+If you want to make the finisher configurable in the backend UI
+read :ref:`here<concepts-formeditor-extending-custom-finisher>`.
+
 
 .. _concepts-frontendrendering-codecomponents-customvalidatorimplementations:
 
index 8e6b918..88c3fea 100644 (file)
@@ -183,3 +183,22 @@ the :yaml:`defaultValue` is prioritized.
 
 Learn more :ref:`here<typo3.cms.form.prototypes.\<prototypeIdentifier>.formelementsdefinition.\<formelementtypeidentifier>.defaultValue>`
 and see the forge issue `#82422 <https://forge.typo3.org/issues/82422#note-6>`_.
+
+
+.. _faq-form-element-custom-finisher:
+
+How do I create a custom finisher for my form?
+==============================================
+
+:ref:`Learn how to create a custom finisher here.<concepts-frontendrendering-codecomponents-customfinisherimplementations>`
+
+If you want to make the finisher configurable in the backend UI read :ref:`here<concepts-formeditor-extending-custom-finisher>`.
+
+
+.. _faq-form-element-custom-validator:
+
+How do I create a custom validator for my form?
+==============================================
+
+:ref:`Learn how to create a custom validator here.<concepts-frontendrendering-codecomponents-customvalidatorimplementations>`
+