Elements
This is the list of elements and their nesting in the Data Structure.
Elements Nesting Other Elements ("Array" Elements)
All elements defined here cannot contain any string value but must contain another set of elements.
(In a PHP array this corresponds to saying that all these elements must be arrays.)
Changed in version 12.0
The superfluous array key TCEforms
was removed and is not evaluated
anymore. Its sole purpose was to wrap real TCA definitions. The TCEforms
tags should
be removed upon dropping TYPO3 v11 support. In TYPO3 v12 there is an automatic migration
that will be removed in a future version.
Element |
Description |
Child elements |
---|---|---|
<T3DataStructure> |
Document tag |
<meta> <ROOT> or <sheets> |
<meta> |
Can contain application specific meta settings |
(depends on application) |
<ROOT> <[field name]> |
Defines an "object" in the Data Structure
|
<type> <section> <el> <[application tag]> |
<sheets> |
Defines a collection of "sheets" which is like a one-dimensional list of independent Data Structures |
<[sheet name]> |
<sheetTitle> |
Title of the sheet. Mandatory for any sheet except the first (which gets "General" in this case). Can be a plain string or a reference to language file using standard LLL syntax. Ignored if sheets are not defined for the flexform. | |
<displayCond> |
Condition that must be met in order for the sheet to be displayed. If the condition is not met, the sheet is hidden. For more details refer to the description of the "displayCond" property in the TCA Reference. | |
<[sheet ident]> |
Defines an independent data structure starting with a <ROOT> tag. Note Alternatively it can be a plain value referring to another XML file which contains the <ROOT> structure. See example later. |
<ROOT> |
<el> |
Contains a collection of Data Structure "objects" |
<[field name]> |
Elements can use the attribute type
to define their type, for example explicitly use boolean.
An example would look like:
<required type="boolean">1</required>
Elements Containing Values ("Value" Elements)
All elements defined here must contain a string value and no other XML tags whatsoever!
(In a PHP array this corresponds to saying that all these elements must be strings or integers.)
Element |
Format |
Description |
---|---|---|
<type> |
Keyword string: "array", [blank] (=default) |
Defines the type of object.
Note If the object was <ROOT> this tag must have the value "array" |
<section> |
Boolean |
Defines for an object of the type <array> that it must contain other "array" type objects in each item of <el>. The meaning of this is application specific. For FlexForms it will allow the user to select between possible arrays of objects to create in the form. This is similar to the concept of IRRE / inline TCA definitions. |
Changed in version 13.0
The usage of available element types within FlexForm sections is
restricted. You should only use simple TCA types like
type => 'input'
within sections, and relations (type =>
'group'
, type => 'inline'
, type => 'select'
and similar)
should be avoided.
TYPO3 v13 specifically disallows using type => 'select'
with
a foreign_
set, which will raise an exception.
This does not apply for FlexForm fields outside of a <section>
.
Details can be found in
Breaking: #102970 - No database relations in FlexForm container sections.
Example
Below is the structure of a basic FlexForm from the example extension typo3/cms-styleguide :
<T3DataStructure>
<sheets>
<sDEF>
<ROOT>
<sheetTitle>Sheet Title</sheetTitle>
<type>array</type>
<el>
<input_1>
<label>input_1</label>
<config>
<type>input</type>
</config>
</input_1>
</el>
</ROOT>
</sDEF>
</sheets>
</T3DataStructure>
For a more elaborate example, have a look at the plugin configuration of
system extension felogin
(EXT:felogin/Configuration/FlexForms/Login.xml (GitHub)).
It shows an example of relative complex data structure used in a FlexForm.
More information about such usage of FlexForms can be found in the relevant section of the TCA reference.