XML Elements in T3DataStructure
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 a string value but must contain a 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.
<T3DataStructure>
-
- Type
- array
This is the root element of a T3DataStructure. It may contain tags
<meta>
and<ROOT>
or<sheets>
<T3DataStructure>
-
- Type
- array
Can contain application specific meta settings. Interpretation depends on the application using the T3DataStructure. Each setting goes to a XML tag.
<ROOT>
-
- Type
- array
Defines an "object" in the Data Structure
Tag
<ROOT>
is reserved for the first element in the Data Structure. The<ROOT>
tag must have a<type>
tag with the value "array" as child and then define other objects nested in<el>
tags.Can have the following child tags:
<type>
,<section>
,<el>
<
.[application tag]>
<[field name]>
-
- Type
- array
Defines an "object" in the Data Structure,
[field name]
defines the objects name.Can have the same child tags like
<ROOT>
.
<sheets>
-
- Type
- array
Defines a collection of "sheets" which is like a one-dimensional list of independent Data Structures.
Contains
<
tags for the actual sheets.[sheet name]>
<sheetTitle>
-
- Type
- string or LLL reference
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 a language file using standard LLL syntax. Ignored if sheets are not defined for the FlexForm.
<displayCond>
-
- Type
- array
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]>
-
- Type
- array
Defines an independent data structure starting with a
<ROOT>
tag.Alternatively, it can be a plain value referring to another XML file which contains the <ROOT> structure. See example later.
<el>
-
- Type
- array
Contains a collection of Data Structure "objects"
Elements can use the attribute
type
to define their type, for example
they can 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.)
<type>
-
- Type
- Keyword string:
"array"
,""
(blank) - Default
""
(blank)
Defines the type of object.
"array"
- The parent tag contains a collection of other
objects defined inside the <el> tag on the same level. If the value is
"array"
you can use the tag<section>
. See below. ""
(blank)- The parent does not contain sub objects. The meaning of an object is determined by the application using the data structure. For FlexForms this object would draw a form element.
If the parent is
<ROOT>
this tag must have the value"array"
.
<section>
-
- Type
- Boolean
- Default
""
(blank)
Defines that an object of type <array> must contain other "array" 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 that they can create in the form. This is similar to the concept of IRRE / inline TCA definitions.
Changed in version 13.0
Available element types inside FlexForm sections is
restricted. You should only use simple TCA types like
type => 'input'
in sections. Relations (
type =>
'group'
,
type => 'inline'
,
type => 'select'
and similar)
should be avoided.
TYPO3 v13 forbids 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.
T3DataStructure example: A simple FlexForm
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 detailed example, have a look at the plugin configuration of
system extension felogin
(EXT:felogin/Configuration/FlexForms/Login.xml (GitHub)).
It shows an example of a relatively complex data structure used in a FlexForm.
More information about using FlexForms can be found in the relevant section of the TCA reference.