.. include:: /Includes.rst.txt .. _columns-flex-facts: =============== FlexForm syntax =============== .. note:: This section is still messy, should be merged with the section from :ref:`Core API ` and :ref:`t3coreapi:flexforms` and should be much easier to understand. FlexForms create a form-in-a-form. The content coming from this form is still stored in the associated database field - but as an XML structure, stored by :code:`\TYPO3\CMS\Core\Utility\GeneralUtility::xml2array()`. The "TCA" information needed to generate the FlexForm fields are found inside a XML document. When you configure a FlexForm field in a Data Structure (DS) you can use basically all column types documented here for TCA. The limitations are: * "unique" and "uniqueInPid" evaluation is not available * You cannot nest FlexForm configurations inside of FlexForms. * You cannot add, change or remove fields in FlexForms without copying the data structure and changing the configuration accordingly. * Charset follows that of the current backend UTF-8. When storing FlexForm information in external files, make sure that they are using UTF-8 too. * :php:`type='inline'` and other types that point to different tables are not allowed in FlexForm section containers. .. versionchanged:: 13.0 Since TYPO3 13.0, also :php:`type='select'` (when using :php:`foreign_table`) is not allowed and will raise an exception when used. Note this only applies to FlexForm sections, not general FlexForm usage. .. _columns-flex-tceforms: .. versionchanged:: 12.0 The superfluous array key `TCEforms` was removed and is not evaluated anymore. Its sole purpose was to wrap real TCA definitions. The tag `TCEforms` **should** be removed upon dropping TYPO3 v11 support. The tables below documents the extension elements: .. _columns-flex-tceforms-array: Array Elements ============== .. _columns-flex-tceforms-array-meta: ------ :aspect:`Element` Can contain application specific meta settings. For FlexForms this means a definition of how languages are handled in the form. .. _columns-flex-tceforms-array-application-tag: <[application tag]> ------------------- :aspect:`Element` A direct reflection of a ['columns']['field name']['config'] PHP array configuring a field in TCA. As XML, this is expressed by array2xml()'s output. .. _columns-flex-tceforms-array-root-tceforms: ------ :aspect:`Element` For elements in the DS you can add application specific information about the sheet that the element represents. Child elements .. _columns-flex-tceforms-value: Value Elements ============== .. _columns-flex-tceforms-value-sheettitle: ------------ :aspect:`Element` :aspect:`Format` string or LLL reference Specifies the title of the sheet. .. _columns-flex-tceforms-value-sheetdescription: ------------------ :aspect:`Element` :aspect:`Format` string or LLL reference Specifies a description for the sheet shown in the flexform. .. _columns-flex-tceforms-value-sheetshortdescr: ----------------- :aspect:`Element` :aspect:`Format` string or LLL reference Specifies a short description of the sheet used in the tab-menu. .. _columns-flex-sheets: Sheets and FlexForms ==================== FlexForms always resolve sheet definitions in a Data Structure. If only one sheet is defined that must be the "sDEF" sheet (default). In that case no tab-menu for sheets will appear (see examples below). .. _columns-flex-data-format: FlexForm data format, =================================== When saving FlexForm elements the content is stored as XML using :code:`\TYPO3\CMS\Core\Utility\GeneralUtility::array2xml()` to convert the internal PHP array to XML format. The structure is as follows: .. _columns-flex-data-format-array: .. _columns-flex-data-format-array-t3flexforms: ------------- :aspect:`Element` Document tag Child elements .. _columns-flex-data-format-array-meta: ------ :aspect:`Element` Meta data for the content. For instance information about which sheet is active etc. .. _columns-flex-data-format-array-data: ------ :aspect:`Element` Contains the data: sheets, language sections, field and values Child elements .. _columns-flex-data-format-array-sheet: -------- :aspect:`Element` Contains the data for each sheet in the form. If there are no sheets, the default sheet "" is always used. Child elements .. _columns-flex-data-format-array-sdef: """""" :aspect:`Element` For each sheet it contains elements for each language. only the tag is used. Child elements .. _columns-flex-data-format-array-ldef: ------ :aspect:`Element` For each language the fields in the form will be available on this level. Child elements <[field name]> .. _columns-flex-data-format-array-field-name: <[field name]> -------------- :aspect:`Element` <[field name]> For each field name there is at least one element with the value, . Child elements .. _columns-flex-data-format-value: .. _columns-flex-data-format-value-vdef: ------ :aspect:`Element` :aspect:`Format` string Content of the field in default or localized versions.