Attention

TYPO3 v8 has reached its end-of-life March 31st, 2020 and is not maintained by the community anymore. Looking for a stable version? Use the version switch on the top left.

You can order Extended Long Term Support (ELTS) here: TYPO3 ELTS.

['ctrl']

Introduction

The ['ctrl'] section contains properties for a database table in general.

These properties are basically divided into two main categories:

  • Properties which affect how a table is displayed and handled in the backend interface. This includes which icon is shown and which name is given for a record. It defines which column contains the title value, which column contains the type value etc.

  • Properties which determine how entries in the backend interface are processed by the system (TCE). This includes the publishing control, the "deleted" flag, whether a table can only be edited by admin-users, whether a table may only exist in the tree root etc.

Examples

'ctrl' => [
    'title' => 'LLL:EXT:myExtension/Resources/Private/Language/general.xlf:tableTitle',
    'label' => 'title',
    'iconfile' => 'EXT:myExtension/Resources/Public/Icons/someIcon.svg',
],

Property label is a mandatory setting, but the above properties are a recommended minimum. The list module shows an icon and a translated title of the table, and it uses the value of field title as title for single rows. Single record administration however is limited with this setup: This table does not implement soft delete, record rows can not be sorted between each other, record localization is not possible, and much more. In the database, only columns uid, pid and title are needed in ext_tables.sql with this setup.

Table tt_content makes much more excessive use of the ['ctrl'] section:

'ctrl' => [
    'label' => 'header',
    'label_alt' => 'subheader,bodytext',
    'sortby' => 'sorting',
    'tstamp' => 'tstamp',
    'crdate' => 'crdate',
    'cruser_id' => 'cruser_id',
    'title' => 'LLL:EXT:frontend/Resources/Private/Language/locallang_ttc.xlf:tt_content',
    'delete' => 'deleted',
    'versioningWS' => true,
    'origUid' => 't3_origuid',
    'type' => 'CType',
    'descriptionColumn' => 'rowDescription',
    'hideAtCopy' => true,
    'prependAtCopy' => 'LLL:EXT:lang/locallang_general.xlf:LGL.prependAtCopy',
    'copyAfterDuplFields' => 'colPos,sys_language_uid',
    'useColumnsForDefaultValues' => 'colPos,sys_language_uid,CType',
    'shadowColumnsForNewPlaceholders' => 'colPos',
    'transOrigPointerField' => 'l18n_parent',
    'translationSource' => 'l10n_source',
    'transOrigDiffSourceField' => 'l18n_diffsource',
    'languageField' => 'sys_language_uid',
    'enablecolumns' => [
        'disabled' => 'hidden',
        'starttime' => 'starttime',
        'endtime' => 'endtime',
        'fe_group' => 'fe_group'
    ],
    'typeicon_column' => 'CType',
    'typeicon_classes' => [
        'header' => 'mimetypes-x-content-header',
        'textpic' => 'mimetypes-x-content-text-picture',
        ...
        'default' => 'mimetypes-x-content-text'
    ],
    'searchFields' => 'header,header_link,subheader,bodytext,pi_flexform',
],

A few remarks:

  • When tt_content records are displayed in the backend, the "label" property indicates that you will see the content from the field named "header" shown as the title of the record. If that field is empty, the content of field subheader and if empty, of field bodytext is used as title.

  • The field called "sorting" will be used to determine the order in which tt_content records are displayed within each branch of the page tree.

  • The title for the table as shown in the backend is defined as coming from a "locallang" file.

  • The "type" field will be the one named "CType". The value of this field determines the set of fields shown in the edit forms in the backend, see the ['types'] section for details.

  • Of particular note is the "enablecolumns" property. It is quite extensive for this table since it is a frontend-related table. Thus proper access rights, publications dates, etc. must be enforced.

  • Every type of content element has its own icon and its own class, used in conjunction with the Icon API to visually represent that type in the TYPO3 backend.

adminOnly

Datatype

boolean

Scope

Proc. / Display

Description

Records can be changed only by "admin"-users (having the "admin" flag set).

Example from the "frontend" extension that defines the table "sys_template" as being editable only by admin users:

'ctrl' => [
    'adminOnly' => 1,
    ...
],

container

Datatype

array

Scope

Display

Description

Array to configure additional items in render containers of FormEngine, see section Node expansion.

Next to single elements, some render container allow to be "enriched" with additional information via the "node expansion" API. Currently, the OuterWrapContainer implements fieldWizard and fieldInformation. InlineControlContainer implements fieldWizard and comes with the default wizard localizationStateSelector. Custom containers may implement expansion nodes, too, and if implemented correctly will automatically have their configuration merged with the definition provided in this TCA array.

The basic array looks like:

'ctrl' => [
    'container' => [
        'containerRenderType' => [
            'fieldWizard' => [
                'aName' => [
                    'renderType' => 'aRenderType',
                    'before' => [ 'anotherName' ],
                    'after' => [ 'yetAnotherName' ],
                    'disabled' => false,
                    'options' => [],
                ],
            ],
        ],
    ],
],
  • "renderType" refers to a registered node name from NodeFactory

  • "before" and "after" can be set to sort single wizards relative to each other.

  • "disabled" can be used to disable built in default wizards.

  • Some wizards may support additional "options".

  • Note, next to "fieldWizard", some containers may also implement "fieldInformation", which can be manipulated the same way.

Example disabling a built-in wizards:

'ctrl' => [
    'container' => [
        'inlineControlContainer' => [
            'fieldWizard' => [
                'localizationStateSelector' => [
                    'disabled' => true,
                ],
            ],
        ],
    ],
],

This disables the default localizationStateSelector fieldWizard of inlineControlContainer.

Example adding own wizard:

$GLOBALS['TYPO3_CONF_VARS']['SYS']['formEngine']['nodeRegistry'][1486488059] = [
    'nodeName' => 'ReferencesToThisRecordWizard',
    'priority' => 40,
    'class' => \T3G\AgencyPack\EditorsChoice\FormEngine\FieldWizard\ReferencesToThisRecordWizard::class,
];

Register an own node in a ext_localconf.php.

$GLOBALS['TCA']['tt_content']['ctrl']['container'] = [
    'outerWrapContainer' => [
        'fieldWizard' => [
            'ReferencesToThisRecordWizard' => [
                'renderType' => 'ReferencesToThisRecordWizard',
            ],
        ],
    ],
];

Register the new node as "fieldWizard" of "tt_content" table in an Configuration/TCA/Overrides/tt_content.php file. In PHP, the node has to implement an interface, but can return any additional HTML which is rendered in the "OuterWrapContainer" between the record title and the field body when editing a record:

A new field wizard in OuterWrapContainer

A new field wizard in OuterWrapContainer

copyAfterDuplFields

Datatype

string (list of field names)

Scope

Proc.

Description

The fields in this list will automatically have the value of the same field from the "previous" record transferred when they are copied or moved to the position after another record from same table.

Example from "tt_content" table:

'ctrl' => [
    'copyAfterDuplFields' => 'colPos, sys_language_uid',
    ...
],

crdate

Datatype

string (field name)

Scope

Proc.

Description

Field name, which is automatically set to the current timestamp when the record is created. Is never modified again. Typically the name "crdate" is used for that field. See tstamp example.

cruser_id

Datatype

string (field name)

Scope

Proc.

Description

Field name, which is automatically set to the uid of the backend user (be_users) who originally created the record. Is never modified again. Typically the name "cruser_id" is used for that field. See tstamp example.

default_sortby

Datatype

string

Scope

Display

Description

If a field name for sortby is defined, then this is ignored.

Otherwise this is used as the 'ORDER BY' statement to sort the records in the table when listed in the TYPO3 backend. It is possible to have multiple field names in here, and each can have an ASC or DESC keyword. Note that the value should not be prefixed with 'ORDER BY' in itself.

Example:

'ctrl' => [
    'default_sortby' => 'title',
    ...
],
'ctrl' => [
    'default_sortby' => 'title ASC, bodytext ASC',
    ...
],

Important

Do not confuse this property with sortby: default_sortby should be set only if there is no sortby. The sortby field (typically set to sorting) contains an integer for explicit sorting , the backend then shows "up" and "down" buttons to manage sorting of records relative to each other. The default_sortby should only be set if that explicit sorting is not wanted or useful. For instance, the list of frontend users is sorted by username and has no other explicit sorting field in the database.

delete

Datatype

string (field name)

Scope

Proc. / Display

Description

Field name, which indicates if a record is considered deleted or not.

If this "soft delete" feature is used, then records are not really deleted, but just marked as 'deleted' by setting the value of the field name to "1". In turn, the whole system must strictly respect the record as deleted. This means that any SQL query must exclude records where this field is true.

This is a very common feature. Most tables use it throughout the TYPO3 Core. The core extension "recycler" can be used to "revive" those deleted records again.

descriptionColumn

Datatype

string (field name)

Scope

Display

Description

Field name where description of a record is stored in. This description is only displayed in the backend to guide editors and admins and should never be shown in the frontend. If filled, the content of this field is displayed in the page and list module, and shown above the field list if editing a record. It is meant as a note field to give editors important additional information on single records. The TYPO3 core sets this property for a series of main tables like be_users, be_groups and tt_content.

Record information in a be_groups row

Record information shown editing a be_groups row

editlock

Datatype

string (field name)

Scope

Proc. / Display

Description

Field name, which – if set – will prevent all editing of the record for non-admin users.

The field should be configured as a checkbox type. Non-admins could be allowed to edit the checkbox but if they set it, they will effectively lock the record so they cannot edit it again – and they need an Admin-user to remove the lock.

Note that this flag is cleared when a new copy or version of the record is created.

This feature is used on the pages table, where it also prevents editing of records on that page (except other pages)! Also, no new records (including pages) can be created on the page.

enablecolumns

Datatype

array

Scope

Proc. / Display

Description

Specifies which publishing control features are automatically implemented for the table.

This includes that records can be "disabled" or "hidden", have a starting and/or ending time and be access controlled so only a certain front end user group can access them. This property is used by the RestrictionBuilder to create SQL fragments.

These are the keys in the array you can use. Each of the values must be a field name in the table which should be used for the feature:

disabled

Defines which field serves as hidden/disabled flag.

starttime

Defines which field contains the starting time.

endtime

Defines which field contains the ending time.

fe_group

Defines which field is used for access control via a selection of FE user groups.

Note

In general these fields do not affect the access or display in the backend! They are primarily related to the frontend. However the icon of records having these features enabled will normally change as these examples show:

Enable fields show up as icon overlays

FE group restricted access showing up on modified record icons

See also the delete feature which is related, but is active for both frontend and backend.

Example from table "tt_content":

'enablecolumns' => [
    'disabled' => 'hidden',
    'starttime' => 'starttime',
    'endtime' => 'endtime',
    'fe_group' => 'fe_group'
],

EXT

Datatype

array

Scope

(variable, depends on extension)

Description

User-defined content for extensions. You can use this as you like.

Let's say that you have an extension with the key "myext", then it is ok to define properties for:

['ctrl']['EXT']['myext'] = ... (whatever you define)

Note this is just a convention. You can use some other syntax but with the risk that it conflicts with some other extension or future changes in the TYPO3 Core.

formattedLabel_userFunc

Datatype

string

Scope

Display

Description

Similar to label_userFunc but allowes to return formatted HTML for the label and used only for the labels of inline (IRRE) records. The referenced user function may receive optional arguments using the formattedLabel_userFunc_options property.

Example from table "sys_file_reference"

'formattedLabel_userFunc' => TYPO3\CMS\Core\Resource\Service\UserFileInlineLabelService::class . '->getInlineLabel',
'formattedLabel_userFunc_options' => [
    'sys_file' => [
        'title',
        'name'
    ]
],

See class TYPO3\CMS\Core\Resource\Service\UserFileInlineLabelService for how such a user function should be designed and how the options are used.

formattedLabel_userFunc_options

Datatype

string

Scope

Display

Description

Options for formattedLabel_userFunc.

groupName

Datatype

string

Scope

Special

Description

This option can be used to group records in the new record wizard. If you define a new table and set its "groupName" to the key of another extension, the table will appear in the list of records from that other extension in the new record wizard.

hideAtCopy

Datatype

boolean

Scope

Proc.

Description

If set, and the "disabled" field from enablecolumns is specified, then records will be disabled/hidden when they are copied.

hideTable

Datatype

boolean

Scope

Display

Description

Hide this table in record listings, especially the list module.

iconfile

Datatype

string

Scope

Display

Description

Pointing to the icon file to use for the table. Icons should be square SVGs. In case you cannot supply a SVG you can still use a PNG file of 64x64 pixels in dimension.

Example usage from the "examples" extension:

'ctrl' => [
    'iconfile' => 'EXT:examples/Resources/Public/Images/Haiku.svg',
    ...
],

is_static

Datatype

boolean

Scope

Used by import/export

Description

This marks a table to be "static".

A "static table" means that it should not be updated for individual databases because it is meant to be centrally updated and distributed. For instance static tables could contain country-codes used in many systems.

The foremost property of a static table is that the uid's used are the SAME across systems. Import/Export of records expect static records to be common for two systems.

label

Datatype

string (field name)

Scope

Display

Description

Required!

Points to the field name of the table which should be used as the "title" when the record is displayed in the system.

Note

label_userFunc overrides this property (but it is still required).

Warning

For the label only regular input or text fields should be used. Otherwise issues may occur and prevent from a working system if TCEMAIN.table.tt_content.disablePrependAtCopy is not set or set to 0.

label_alt

Datatype

String (comma-separated list of field names)

Scope

Display

Description

Comma-separated list of field names, which are holding alternative values to the value from the field pointed to by "label" (see above) if that value is empty. May not be used consistently in the system, but should apply in most cases.

Example for table "tt_content"

'ctrl' => [
    'label' => 'header',
    'label_alt' => 'subheader,bodytext',
],

Note

label_userFunc overrides this property, als see label_alt_force.

label_alt_force

Datatype

boolean

Scope

Display

Description

If set, then the label_alt fields are always shown in the title separated by comma.

Note

label_userFunc overrides this property.

label_userFunc

Datatype

string

Scope

Display

Description

Function or method reference. This can be used whenever the label or label_alt options don't offer enough flexibility, e.g. when you want to look up another table to create your label. The result of this function overrules the label, label_alt and label_alt_force settings.

When calling a method from a class, enter "[classname]->[methodname]". Two arguments will be passed to the method: The first argument is an array which contains the following information about the record for which to get the title:

$params['table'] = $table;
$params['row'] = $row;

The resulting title must be written to $params['title'], which is passed by reference. The second argument is a reference to the parent object.

Warning

The title is passed later on through htmlspecialchars() so it may not include any HTML formatting.

Example:

Let's look at what is done for the "haiku" table of the "examples" extension. The call to the user function appears in the EXT:examples/Configuration/TCA/tx_examples_haiku.php file:

'ctrl' => [
    'label' => 'title',
    'label_userFunc' => \Documentation\Examples\Userfuncs\Tca::class . '->haikuTitle',
],

Class Documentation\Examples\Userfuncs\Tca contains the code itself:

public function haikuTitle(&$parameters, $parentObject)
{
    $record = BackendUtility::getRecord($parameters['table'], $parameters['row']['uid']);
    $newTitle = $record['title'];
    $newTitle .= ' (' . substr(strip_tags($record['poem']), 0, 10) . '...)';
    $parameters['title'] = $newTitle;
}

label_userFunc_options

Datatype

string

Scope

Display

Description

Options for label_userFunc. The array of options is passed to the user function in the parameters array with key "options".

Note

When the label_userFunc is used for inline (IRRE) elements, the options are not passed. If you need options use formattedLabel_userFunc instead.

languageField

Datatype

string (field name)

Scope

Proc. / Display

Description

Localization access control.

Field name which contains the pointer to the language of the record's content. Language for a record is defined by an integer pointing to a "sys_language" record (found in the page tree root).

Backend users can be limited to have edit access for only certain of these languages and if this option is set, edit access for languages will be enforced for this table.

The values in this field may be the following:

-1 : (ALL) The record does not represent any specific language. Localization access control is never carried out for such a record. Typically this is used if the record has content which itself handles localization (such as plugins or flexforms).

0 : The default language of the system. Localization access control applies.

Values > 0 : Points to a uid of a sys_language record representing a possible language for translation. Localization access control applies.

The field name pointed to should be a single value selector box (maxitems <=1) saving its value into an integer field in the database.

Also see the Frontend Localization Guide for a discussion about the effects of this property (and other TCA properties) on the localization process.

origUid

Datatype

string (field name)

Scope

Proc.

Description

Field name, which will contain the UID of the original record in case a record is created as a copy or new version of another record.

Is used when new versions are created from elements and enables the backend to display a visual comparison between a new version and its original.

prependAtCopy

Datatype

string or LLL reference

Scope

Proc.

Description

This string will be prepend the records title field when the record is inserted on the same PID as the original record to distinguish them.

Usually the value is something like " (copy %s)" which tells that it was a copy that was just inserted (The token "%s" will take the copy number).

readOnly

Datatype

boolean

Scope

Proc. / Display

Description

Records from this table may not be edited in the TYPO3 backend. Such tables are usually called "static". If set, this property is often combined with a ext_tables_static+adt.sql file to automatically populate the table with rows.

rootLevel

Datatype

[0, 1, -1]

Scope

Proc. / Display

Description

Determines where a record may exist in the page tree. There are three options depending on the value:

  • 0 (false): Default. Can only exist in the page tree. Records from this table must belong to a page (i.e. have a positive "pid" field value). Thus records cannot be created in the root of the page tree (where "admin" users are the only ones allowed to create records anyways). This is the default behavior.

  • 1 (true): Can only exist in the root. Records must have a "pid"-field value equal to zero. The consequence is that only admin can edit this record.

  • -1: Can exist in both page tree and root. Records can belong either to a page (positive "pid" field value) or exist in the root of the page tree (where the "pid" field value will be 0 (zero)). Note: the -1 value will still select foreign_table records for selector boxes only from root (pid=0)

Note

The setting for "rootLevel" is ignored for records in the "pages" table (they are hardcoded to be allowed anywhere, equal to a "-1" setting of rootLevel).

Warning

This property does not tell the whole story. If set to "0" or "-1", it allows records from the table in the page tree, but not on any kind of page. By default records can be created only in "Folder"-type pages. To enable the creation of records on any kind of page, an additional call must be made in ext_tables.php:

\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::allowTableOnStandardPages('tx_examples_haiku');

searchFields

Datatype

string

Scope

Search

Description

Comma-separated list of fields from the table that will be included when searching for records in the TYPO3 backend. No record from a table will ever be found if that table does not have "searchFields" defined.

There are more fine grained controls per column, see the "search" in this manual.

Example from "tt_content" table:

'ctrl' => [
    'searchFields' => 'header,header_link,subheader,bodytext,pi_flexform',
    ...
],

security

Datatype

array

Scope

Display

Description

Array of sub-properties. This is used in the core for the "sys_file" table:

$GLOBALS['TCA']['sys_file'] = [
    'ctrl' => [
        'security' => [
            'ignoreWebMountRestriction' => true,
            'ignoreRootLevelRestriction' => true,
        ],
        ...
    ],
];
ignoreWebMountRestriction

Allows users to access records that are not in their defined web-mount, thus bypassing this restriction.

ignoreRootLevelRestriction

Allows non-admin users to access records that on the root-level (page-id 0), thus bypassing this usual restriction.

selicon_field

Datatype

string (field name)

Scope

Display

Description

Field name, which contains the thumbnail image used to represent the record visually whenever it is shown in FormEngine as a foreign reference selectable from a selector box.

Only images in a usual format for the web (i.e. gif, png, jpeg, jpg) are allowed. No scaling is done. Also see selicon_field_path.

You should consider this a feature where you can attach an "icon" to a record which is typically selected as a reference in other records, for example a "category". In such a case this field points out the icon image which will then be shown. This feature can thus enrich the visual experience of selecting the relation in other forms.

Example from table "backend_layout":

'ctrl' => [
    'selicon_field' => 'icon',
    'selicon_field_path' => 'uploads/media',
    ...
],

selicon_field_path

Datatype

string

Scope

Display

Description

The path prefix of the value from selicon_field. This must the same as the "upload_path" of that field, see example in selicon_field.

setToDefaultOnCopy

Datatype

string (list of field names)

Scope

Proc.

Description

These fields are restored to the default value of the record when they are copied.

Example from "sys_action" table:

'ctrl' => [
    'setToDefaultOnCopy' => 'assign_to_groups',
    ...
],

shadowColumnsForNewPlaceholders

Datatype

string (list of field names)

Scope

Proc.

Description

When a new element is created in a draft workspace, a placeholder element is created in the Live workspace. Some values must be stored in this placeholder and not just in the overlay record. A typical example would be sys_language_uid. This property defines the list of fields whose values are "shadowed" to the Live record.

All fields listed for this option must be defined in $GLOBALS['TCA'][<table>]['columns'] as well.

Furthermore fields which are listed in transOrigPointerField, languageField, label and type are automatically added to this list of fields and do not have to be mentioned again here.

Example from "sys_filemounts" table:

'ctrl' => [
    'shadowColumnsForNewPlaceholders' => 'sys_language_uid,l18n_parent,colPos',
    ...
],

shadowColumnsForMovePlaceholders

Datatype

string (list of field names)

Scope

Proc.

Description

Similar to shadowColumnsForNewPlaceholders but for move placeholders. It is used when:

  • Changing the sorting order of elements on the same page

  • Moving elements to a different page

Note: Since TYPO3 CMS 7 LTS move-placeholders are always used.

sortby

Datatype

string (field name)

Scope

Proc. / Display

Description

Field name, which is used to manage the order of the records when displayed.

The field contains an integer value which positions it at the correct position between other records from the same table on the current page.

This feature is used by e.g. the "pages" table and "tt_content" table (Content Elements) in order to output the pages or the content elements in the order expected by the editors. Extensions are expected to respect this field.

Typically the field name sorting is dedicated to this feature.

'ctrl' => [
    'sortby' => 'sorting',
    ...
],

Note

The field should not be made editable by the user since the DataHandler will manage the content automatically.

Important

Do not confuse this property with default_sortby. The sortby field contains an integer and is managed by the DataHandler. If by accident a content column like "title" is set as sortby, the DataHandler will write these integers into that field, which is most likely not what you want.

thumbnail

Datatype

string (field name)

Scope

Display

Description

Field name, which contains the value for any thumbnails of the records. This could be a field of type "inline", usually a "sys_file_reference" / FAL record.

Example:

For the "tt_content" table this option could point to the field "image" or "media" which contains the list of images that can be attached to the content element. You might have to enable "Show Thumbnails by default" in the "Edit and Advanced functions" tab of the User Settings module first in order to see this display.

'ctrl' => [
    'thumbnail' => 'image',
    ...
],

The effect of the field can be seen in listings in e.g. the "Web > List" module:

Thumbnails in the list module

Thumbnails in the List module

title

Datatype

string or LLL reference

Scope

Display

Description

Contains the system name of the table. Is used for display in the backend.

For instance the "tt_content" table is of course named "tt_content" technically. However in the backend display it will be shown as "Page Content" when the backend language is English. When another language is chosen, like Danish, then the label "Sideindhold" is shown instead. This value is managed by the "title" value.

You can insert plain text values, but the preferred way is to enter a reference to a localized string. Refer to the Localization section in Inside TYPO3 for more details.

Example for table "sys_template"

'ctrl' => [
    'title' => 'LLL:EXT:frontend/Resources/Private/Language/locallang_tca.xlf:sys_template',
],

In the above example the LLL: prefix tells the system to look up a label from a localized file. The next prefix code:EXT:frontend will look for the data in the extension with the key "frontend". In that extension the file locallang_tca.xlf contains a XML structure inside of which one label tag has an index attribute named "sys_template". This tag contains the value to display in the default language. Other languages are provided by the language packs.

translationSource

Datatype

string (field name)

Scope

Proc. / Display

Description

Name of the field used by translations to point back to the original record (i.e. the record in any language of which they are a translation). This property is often set to "l10n_source" in core tables.

This property is similar to transOrigPointerField. Both fields only contain valid record uid's (and not 0), if the record is a translation (connected mode), and not a copy (free mode). In connected mode, while "transOrigPointerField" always contains the uid of the default language record, this field contains the uid of the record the translation was created from.

For example, if a tt_content record in default language english with uid 13 exists, this record is translated to french with uid 17, and the danish translation is later created based on the french translation, then the danish translation has uid 13 set as l10n_parent and 17 as l10n_source.

transOrigDiffSourceField

Datatype

string (field name)

Scope

Proc. / Display

Description

Field name which will be updated with the value of the original language record whenever the translation record is updated. This information is later used to compare the current values of the default record with those stored in this field. If they differ, there will be a display in the form of the difference visually. This is a big help for translators so they can quickly grasp the changes that happened to the default language text.

The field type in the database should be a large text field (clob/blob).

This field needs no configuration in $GLOBALS['TCA'][<table>]['columns'], but if you do, select the "passthrough" type. That will enable the undo function to also work on this field.

transOrigPointerField

Datatype

string (field name)

Scope

Proc. / Display

Description

Name of the field used by translations to point back to the original record, the record in the default language of which they are a translation.

If this value is found being set together with languageField then FormEngine will show the default translation value under the fields in the main form. This is very neat if translators are to see what they are translating.

The target field must be configured in $GLOBALS['TCA'][<table>]['columns'], at least as a passthrough type, in many core tables this property is set to "l10n_parent".

tstamp

Datatype

string (field name)

Scope

Proc.

Description

Field name, which is automatically updated to the current timestamp (UNIX-time in seconds) each time the record is updated/saved in the system. Typically the name "tstamp" is used for that field.

Example from the "haikus" table of the "example" extension:

'ctrl' => [
    'tstamp' => 'tstamp',
    'crdate' => 'crdate',
    'cruser_id' => 'cruser_id',
    ...
],

The above example shows the same definition for the crdate and cruser_id fields.

type

Datatype

string (field name)

Scope

Display / Proc.

Description

Field name, which defines the "record type".

The value of this field determines which one of the types configurations are used for displaying the fields in the FormEngine. It will probably also affect how the record is used in the context where it belongs.

The most widely known usage of this feature is the case of Content Elements where the "Type:" selector is defined as the "type" field and when you change that selector you will also get another rendering of the form:

The type selector

The type selector of content elements

It is also used by the "doktype" field in the "pages" table.

Example:

The "dummy" table from the "examples" extension defines different types. The field used for differentiating the types is the "record_type" field. Hence we have the following in the ['ctrl'] section of the tx_examples_dummy table:

'ctrl' => [
    'type' => 'record_type',
    ...
],

The "record_type" field can take values ranging from 0 to 2. Accordingly we define types for the same values. Each type defines which fields will be displayed in the BE form:

'types' => [
    '0' => [ 'showitem' => 'hidden, record_type, title, some_date' ],
    '1' => [ 'showitem' => 'record_type, title' ],
    '2' => [ 'showitem' => 'title, some_date, hidden, record_type' ],
],

See the section about types for more details.

It is also possible to make the type depend on the value of a related record, i.e. switch using the type field of a foreign table. The syntax is relation_field:foreign_type_field.

Example:

The "sys_file_metadata" table takes its type from the "sys_file" table. The relation between the two tables is stored in the "file" field. Thus the type declaration for "sys_file_metadata" looks like:

'ctrl' => [
    'type' => 'file:type',
    ...
],

typeicon_classes

Datatype

array

Scope

Display

Description

Array of names to use for the records. The keys must correspond to the values found in the column referenced in the typeicon_column property. The values correspond to icons registered in the Icon API.

Example from the `tt_content` table:

'typeicon_classes' => [
    'header' => 'mimetypes-x-content-header',
    'default' => 'mimetypes-x-content-text',
    ...
],

typeicon_column

Datatype

string (field name)

Scope

Display

Description

Field name, whose value decides alternative icons for the table records, the default icon is the one defined with the iconfile value.

The values in the field referenced by this property must match entries in the array defined in typeicon_classes properties. If no match is found, the default icon is used. See example in the related typeicon_classes property.

If used, the value if this property is often set to the same field name as type.

Note

The pages table has a special configuration and relies on the $GLOBALS['PAGES_TYPES'] array.

useColumnsForDefaultValues

Datatype

string (list of field names)

Scope

Proc.

Description

When a new record is created, this defines the fields from the 'previous' record that should be used as default values.

Example from "sys_filemounts" table:

'ctrl' => [
    'useColumnsForDefaultValues' => 'path,base',
    ...
],

versioningWS

Datatype

boolean

Scope

Proc.

Description

If set, versioning is enabled for this table.

Note

The field details explained here are outdated.

Versioning in TYPO3 is based on this scheme:

[Online version, pid>=0] 1- * [Offline versions, pid=-1]

Offline versions are identified by having a pid value = -1 and they refer to their online version by the field "t3ver_oid". Offline versions of the "Page" and "Branch" types (contrary to "Element" type) can have child records which points to the uid of their offline "root" version with their pid fields (as usual). These children records are typically copies of child elements of the online version of the offline root version, but are not considered "versions" of them in a technical sense, hence they don't point to them with their t3ver_oid field (and shouldn't).

In the backend "Offline" is labeled "Draft" while "Online" is labeled "Live".

In order for versioning to work on a table there are certain requirements; Tables supporting versioning must have these fields:

t3ver_oid

For offline versions; pointing back to online version uid. For online: 0 (zero)

t3ver_id

Incremental integer (version number)

t3ver_label

Version label, e.g. "1.1.1" or "Christmas edition"

t3ver_wsid

For offline versions: Workspace ID of version. For all workspace Ids apart from 0 (zero) there can be only one version of an element per ID. For online: 0 (zero) unless t3ver_state is set in which case it plays a role for previews in the backend (to no de-select placeholders for workspaces, see \TYPO3\CMS\Backend\Utility\BackendUtility::versioningPlaceholderClause()) and for publishing of move-to-actions (see \TYPO3\CMS\Backend\Utility\BackendUtility::getMovePlaceholder()).

t3ver_state

Contains special states of a version used when new, deleted, moved content requires versioning.

  • For an online version:

    • "1" or "2" means that it is a temporary placeholder for a new element (which is the offline version of this record)

    • "3" means it is a "move-to-location" placeholder and t3ver_move_id holds uid of online record (with an offline version) to move . Unlike for "1" and "2" there is no offline version of this record type! (V2 feature)

      • If "t3ver_state" has a value >0 it should never be shown in Live workspace.

  • For an offline version:

    • "1" or "2" means that when published, the element must be deleted (placeholder for delete-action).

    • "-1" means it is just an indication that the online version has the flag set to "1" (is a placeholder for new records.). This only affects display, not processing anywhere.

    • "4" means this version is a "move-pointer" for the online record and an online "move-to-location" (t3ver_state=3) record exists. (V2 feature)

t3ver_stage

Contains the ID of the stage at which the record is. Special values are "0" which still refers to "edit", "-10" refers to "ready to publish".

t3ver_count

0/offline=draft/never published, 0/online=current, 1/offline=archive, 1+=multiple online/offline occurrences (incrementation happens when versions are swapped offline.)

t3ver_tstamp

Timestamp of last swap/publish action.

t3ver_move_id

For online records with t3ver_state=3 this indicates the online record to move to this location upon publishing of the offline version of the online record "t3ver_move_id" points to.

The fields pid and uid should have "signed" attributes in MySQL (so their content can be negative!)

Corresponding SQL definitions:

t3ver_oid int(11) DEFAULT '0' NOT NULL,
t3ver_id int(11) DEFAULT '0' NOT NULL,
t3ver_wsid int(11) DEFAULT '0' NOT NULL,
t3ver_label varchar(30) DEFAULT '' NOT NULL,
t3ver_state tinyint(4) DEFAULT '0' NOT NULL,
t3ver_stage int(11) DEFAULT '0' NOT NULL,
t3ver_count int(11) DEFAULT '0' NOT NULL,
t3ver_tstamp int(11) DEFAULT '0' NOT NULL,
t3ver_move_id int(11) DEFAULT '0' NOT NULL,

Special "t3ver_swapmode" field for pages

When pages are versioned it is an option whether content and even the branch of the page is versioned. This is determined by the parameter "treeLevels" set when the page is versioned. "-1" means swap only record, 0 means record and content and >0 means full branch. When the version is later published the swapping will happen accordingly.

versioningWS_alwaysAllowLiveEdit

Datatype

boolean

Scope

Special

Description

If set, this table can always be edited live even in a workspace and even if "live editing" is not enabled in a custom workspace. For instance this is set by default for Backend user and group records since it is assumed that administrators like the flexibility of editing backend users without having to go to the Live workspace.