8
8
TCAdefaults
9
9
===========
10
10
11
+ .. versionadded :: 14.0
12
+ The :typoscript: `TCAdefaults ` configuration has been extended to support
13
+ type-specific syntax similar to `TCEFORM <https://docs.typo3.org/permalink/t3tsref:tceform >`_,
14
+ enabling different default values based on the record type.
15
+
11
16
This allows to set or override the `default ` values of `TCA ` fields that is available
12
- for various TCA types, for instance for :ref: `type=input <t3tca:columns-input-properties-default >`.
17
+ for various TCA column types, for instance for :ref: `type=input <t3tca:columns-input-properties-default >`.
13
18
14
- The full path of a setting include the table and the field name: `TCAdefaults.[table name].[field] `
19
+ Default values can be set on type level: `TCAdefaults.[table name].[field].types.[type] `
20
+ or field level: `TCAdefaults.[table name].[field] `.
15
21
16
- This key is also available on :ref: `User TSconfig level <userTsTcaDefaults >`, the order of default
22
+ This key is also available on :ref: `User TSconfig level <userTsTcaDefaults >` the order of default
17
23
values when creating new records in the backend is this:
18
24
25
+ #. Database field default value
19
26
#. Value from `$GLOBALS['TCA'] `
20
- #. Value from :ref: `user TSconfig <userTsTcaDefaults >`
21
- #. Value from page TSconfig (these settings)
27
+ #. Field-level ref:`user TSconfig <userTsTcaDefaults> `
28
+ #. Type-level ref:`user TSconfig <userTsTcaDefaults> `
29
+ #. Field-level :typoscript: `TCAdefaults ` configuration
30
+ #. Type-level :typoscript: `TCAdefaults ` configuration
22
31
#. Value from "defVals" GET variables
23
32
#. Value from previous record based on
24
33
:ref: `useColumnsForDefaultValues <t3tca:ctrl-reference-usecolumnsfordefaultvalues >`
25
34
35
+ `TCAdefaults ` set via page TSconfig are ignored if the current user has no
36
+ write access to the affected field. In this case use
37
+ :ref: `User TSconfig level <userTsTcaDefaults >`.
38
+
26
39
.. note ::
27
40
`TCAdefaults ` is not applied to :ref: `FlexForm <t3coreapi:flexforms >` values.
28
41
These can only be addressed via :xml: `<default> ` elements within the
29
42
FlexForm data structure.
30
43
44
+
31
45
.. _pageTsTcaDefaults-example :
32
46
33
47
Example: Do not hide newly created pages by default
@@ -37,3 +51,27 @@ Example: Do not hide newly created pages by default
37
51
:caption: EXT:site_package/Configuration/page.tsconfig
38
52
39
53
TCAdefaults.pages.hidden = 0
54
+
55
+ .. _pageTsTcaDefaults-example-type :
56
+
57
+ Example: Set type specific default values
58
+ =========================================
59
+
60
+ .. code-block :: typoscript
61
+ :caption: EXT:site_package/Configuration/page.tsconfig
62
+
63
+ TCAdefaults.tt_content {
64
+ header_layout = 1
65
+ header_layout.types {
66
+ textmedia = 3
67
+ image = 2
68
+ }
69
+
70
+ frame_class = default
71
+ frame_class.types {
72
+ textmedia = ruler-before
73
+ image = none
74
+ }
75
+
76
+ space_before_class = none
77
+ }
0 commit comments