:navigation-title: flex-form .. include:: /Includes.rst.txt .. _flexformprocessor: .. index:: FlexForm, DataProcessing ========================== `flex-form` data processor ========================== TYPO3 offers :ref:`FlexForms ` which can be used to store data within an XML structure inside a single database column. The data processor :php:`\TYPO3\CMS\Frontend\DataProcessing\FlexFormProcessor`, alias `flex-form`, converts the FlexForm data of a given field into a Fluid-readable array. .. contents:: Table of contents .. _flexformprocessor-options: Options ======= .. confval-menu:: :display: table :type: :Default: .. _flexformprocessor-fieldname: .. rubric:: fieldName .. confval:: fieldName :name: FlexFormProcessor-fieldname :type: :ref:`string ` :default: 'pi_flexform' Field name of the column the FlexForm data is stored in. .. _flexformprocessor-references: .. rubric:: references .. confval:: references :name: FlexFormProcessor-references :type: array Associative array of FlexForm fields (key) and the according database field (value). Each FlexForm field, which should be resolved, needs a reference definition to the :ref:`foreign_match_fields `. This reference is used in the :ref:`FilesProcessor ` to resolve the correct :ref:`FAL ` resource. See :ref:`Example of resolving FAL references `. .. _flexformprocessor-as: .. rubric:: as .. confval:: as :name: FlexFormProcessor-as :type: :ref:`string ` :default: 'flexFormData' Name for the variable in the Fluid template. .. _flexformprocessor-examples: Examples ======== .. _flexformprocessor-example-minimal: Example of a minimal TypoScript configuration --------------------------------------------- .. code-block:: typoscript :caption: EXT:my_extension/Configuration/Sets/Main/setup.typoscript 10 = flex-form The converted array can be accessed within the Fluid template with the :html:`{flexFormData}` variable. .. _flexformprocessor-example-advanced: Example of an advanced TypoScript configuration ----------------------------------------------- .. literalinclude:: _codesnippets/_advanced.typoscript :caption: EXT:my_extension/Configuration/Sets/Main/setup.typoscript The converted array can be accessed within the Fluid template with the :html:`{myOutputVariable}` variable. .. _flexformprocessor-example-sub-processor: Example with a custom sub-processor ----------------------------------- .. literalinclude:: _codesnippets/_processor.typoscript :caption: EXT:my_extension/Configuration/Sets/Main/setup.typoscript .. _flexformprocessor-resolving-fal: Example of resolving FAL references ----------------------------------- Example of an advanced TypoScript configuration, which processes the field :xml:`my_flexform_field`, resolves its FAL references and assigns the array to the :typoscript:`myOutputVariable` variable: .. literalinclude:: _codesnippets/_fal.typoscript :caption: EXT:my_extension/Configuration/Sets/Main/setup.typoscript The according FlexForm configuration: .. literalinclude:: _FlexFormWithFal.xml :language: xml :caption: Excerpt of a FlexForm configuration