Feature: #104814 - Automatically add system fields to content types
See forge#104814
Description
All content elements types (
CType
) are usually equipped with the same
system fields (language
, hidden
, etc.) - see also Feature: #104311 - Auto created system TCA columns.
Adding them to the editor form has previously been done by adding those fields
to each content types'
showitem
definition.
In the effort to simplify content element creation, to unify the available
fields and position for the editor and to finally reduce configuration effort
for integrators, those system fields are now added automatically based
on the
ctrl
definition.
Note
The fields are added to the
showitem
through their corresponding
palettes. In case such palette has been changed by extensions, the required
system fields are added individually to corresponding tabs.
The following tabs / palettes are now added automatically:
- The General tab with the
general
palette at the very beginning - The Language tab with the
language
palette after custom fields - The Access tab with the
hidden
andaccess
palettes - The Notes tab with the
row
fieldDescription
As mentioned, in case one of those palettes has been changed to no longer
include the corresponding system fields, those fields are added individually
depending on their definition in the table's
ctrl
section:
- The
ctrl
field (usually[type] CType
) - The
col
fieldPos - The
ctrl
(usually[language Field] sys_
)language_ uid - The
ctrl
field (usually[editlock] editlock
) - The
ctrl
field (usually[enablecolumns] [disabled] hidden
) - The
ctrl
field (usually[enablecolumns] [starttime] starttime
) - The
ctrl
field (usually[enablecolumns] [endtime] endtime
) - The
ctrl
field (usually[enablecolumns] [fe_ group] fe_
)group - The
ctrl
field (usually[description Column] row
)Description
By default, all custom fields - the ones still defined in
showitem
- are
added after the general
palette and are therefore added to the
General tab, unless a custom tab (e.g. Plugin,
or Categories) is defined in between. It is also possible to start
with a custom tab by defining a --
as the first item in the
showitem
. In this case, the General tab will be omitted.
All those system fields, which are added based on the
ctrl
section are
also automatically removed from any custom palette and from the customized
type's
showitem
definition.
If the content element defines the Extended tab, it will be
inserted at the end, including all fields added to the type via API methods,
without specifying a position, e.g. via
Extension
.
Impact
Creating content elements has been simplified by removing the need to
define the system fields for each element again and again. This shrinks
down a content element's
showitem
to just the element specific fields.
A usual migration will therefore look like the following:
Before:
'slider' => [
'showitem' => '
--div--;LLL:EXT:core/Resources/Private/Language/Form/locallang_tabs.xlf:general,
--palette--;;general,
--palette--;;headers,
slider_elements,
bodytext;LLL:EXT:awesome_slider/Resources/Private/Language/locallang_ttc.xlf:bodytext.ALT.slider_description,
--div--;LLL:EXT:core/Resources/Private/Language/Form/locallang_tabs.xlf:appearance,
--palette--;;frames,
--palette--;;appearanceLinks,
--div--;LLL:EXT:core/Resources/Private/Language/Form/locallang_tabs.xlf:language,
--palette--;;language,
--div--;LLL:EXT:core/Resources/Private/Language/Form/locallang_tabs.xlf:access,
--palette--;;hidden,
--palette--;;access,
--div--;LLL:EXT:core/Resources/Private/Language/Form/locallang_tabs.xlf:categories,
categories,
--div--;LLL:EXT:core/Resources/Private/Language/Form/locallang_tabs.xlf:notes,
rowDescription,
--div--;LLL:EXT:core/Resources/Private/Language/Form/locallang_tabs.xlf:extended,
',
],
After:
'slider' => [
'showitem' => '
--palette--;;headers,
slider_elements,
bodytext;LLL:EXT:awesome_slider/Resources/Private/Language/locallang_ttc.xlf:bodytext.ALT.slider_description,
--div--;LLL:EXT:core/Resources/Private/Language/Form/locallang_tabs.xlf:categories,
categories,
--div--;LLL:EXT:core/Resources/Private/Language/Form/locallang_tabs.xlf:extended,
',
],
Since all fields, palettes and tabs, which are defined in the
showitem
are added after the
general
palette, also the Categories tab
- if defined - is displayed before the system tabs / fields. The only special
case is the Extended tab, which is always added at the end.
Important
For consistency reasons, custom labels for system fields are no longer preserved.