Skip to content

Commit

Permalink
[Feature] #94501 - FAL support for FlexFormProcessor
Browse files Browse the repository at this point in the history
  • Loading branch information
brotkrueml committed Oct 22, 2023
1 parent b0c6656 commit 6ce0137
Show file tree
Hide file tree
Showing 2 changed files with 104 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,23 @@ Options

Field name of the column the FlexForm data is stored in.

.. t3-data-processor-flex:: references

.. versionadded:: 13.0

:Required: false
: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 <columns-inline-properties-foreign-match-fields>`.
This reference is used in the :ref:`FilesProcessor <FilesProcessor>` to
resolve the correct :ref:`FAL <t3coreapi:fal>` resource.

See :ref:`FlexFormProcessor-resolving-fal`.

.. t3-data-processor-flex:: as

:Required: false
Expand Down Expand Up @@ -88,3 +105,32 @@ Example with a custom sub-processor
}
}
.. _FlexFormProcessor-resolving-fal:

Example of resolving FAL references
-----------------------------------

.. versionadded:: 13.0

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:

.. code-block:: typoscript
:caption: EXT:my_extension/Configuration/TypoScript/setup.typoscript
10 = flex-form
10 {
fieldName = my_flexform_field
references {
my_flex_form_group.my_flex_form_field = my_field_reference
}
as = myOutputVariable
}
The according FlexForm configuration:

.. literalinclude:: _FlexFormWithFal.xml
:language: xml
:caption: Excerpt of a FlexForm configuration

Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
<my_flex_form_group.my_flex_form_field>
<label>LLL:EXT:sitepackage/Resources/Private/Language/locallang_be.xlf:my_flex_form_field</label>
<config>
<type>file</type>
<maxitems>9</maxitems>
<foreign_selector_fieldTcaOverride>
<config>
<appearance>
<elementBrowserType>file</elementBrowserType>
<elementBrowserAllowed>gif,jpg,jpeg,png,svg</elementBrowserAllowed>
</appearance>
</config>
</foreign_selector_fieldTcaOverride>
<foreign_types type="array">
<numIndex index="0">
<showitem>
--palette--;LLL:EXT:lang/locallang_tca.xlf:sys_file_reference.imageoverlayPalette;imageoverlayPalette,--palette--;;filePalette
</showitem>
</numIndex>
<numIndex index="1">
<showitem>
--palette--;LLL:EXT:lang/locallang_tca.xlf:sys_file_reference.imageoverlayPalette;imageoverlayPalette,--palette--;;filePalette
</showitem>
</numIndex>
</foreign_types>
<appearance type="array">
<headerThumbnail>
<height>64</height>
<width>64</width>
</headerThumbnail>
<enabledControls>
<info>1</info>
<dragdrop>0</dragdrop>
<sort>1</sort>
<hide>0</hide>
<delete>1</delete>
<localize>1</localize>
</enabledControls>
<createNewRelationLinkTitle>
LLL:EXT:frontend/Resources/Private/Language/locallang_ttc.xlf:images.addFileReference
</createNewRelationLinkTitle>
</appearance>
<behaviour>
<localizationMode>select</localizationMode>
<localizeChildrenAtParentLocalization>1</localizeChildrenAtParentLocalization>
</behaviour>
<overrideChildTca>
<types type="array">
<numIndex index="2">
<showitem>
--palette--;LLL:EXT:lang/locallang_tca.xlf:sys_file_reference.imageoverlayPalette;imageoverlayPalette,--palette--;;filePalette
</showitem>
</numIndex>
</types>
</overrideChildTca>
<allowed>jpg,png,svg,jpeg,gif</allowed>
</config>
</my_flex_form_group.my_flex_form_field>

0 comments on commit 6ce0137

Please sign in to comment.