Record Types

Folder: ContentBlocks/RecordTypes.

Record Types are generic Content Types in TYPO3. Basically everything, which is not a Content Element or Page Type. Adding custom records requires you to define a table name. A minimal example looks like this:

EXT:your_extension/ContentBlocks/RecordTypes/my-record-type/EditorInterface.yaml
name: example/my-record-type
table: tx_vendor_my_record_type
labelField: title
fields:
  - identifier: title
    type: Text
Copied!

Check out this comprehensive guide on ways to utilize Record Types.

Options

Here you can find all common root options.

table
Required

true

Type

string

The custom table name to be used for the new Record Type.

table: tx_vendor_my_custom_table_name
Copied!
labelField
Required

true

Type

string|array

Defines which field should be used as the title of the record. If not defined, the first valid child field will be used as the label. It is possible to define an array of fields, which will be displayed comma-separated in the backend.

# a single field for the label
labelField: title

# multiple fields will be displayed comma-separated
labelField:
    - title
    - text
Copied!
fallbackLabelFields
Required

false

Type

array

Defines which fields should be used as fallback, if labelField is not filled. The first filled field which is found will be used. Can only be used if there is only one labelField field defined.

# fallback fields will be used, if title from labelField is empty
labelField: title
fallbackLabelFields:
    - text1
    - text2
Copied!
typeField
Required

false

Type

string

The field identifier to use as the type switch. This field will be automatically generated and prepended as the very first field. The item list is filled automatically as well. There is no need to define this field manually in your fields list. Useful, if you want to define multiple types for a single table (single table inheritance).

typeField: type
Copied!
typeName
Required

false

Type

string

Default

automatically generated from name

The identifier of the new Record Type. It is automatically generated from the name, if not defined manually.

typeName: type1
Copied!
languageAware
Required

false

Type

boolean

Default

true

If set to false, language related fields are not created. Namely sys_language_uid, l10n_parent, l10n_source and l10n_diffsource.

# disable language support
languageAware: false
Copied!
workspaceAware
Required

false

Type

boolean

Default

true

Creates workspace related fields. Namely t3ver_oid, t3ver_wsid, t3ver_state and t3ver_stage. If EXT:workspaces is not installed, these fields won't be created.

# disable workspaces support
workspaceAware: false
Copied!
editLocking
Required

false

Type

boolean

Default

true

If set to false, the functionality to lock the editing for editors is removed. This refers to the editlock field.

# disable edit lock field
editLocking: false
Copied!
restriction
Required

false

Type

array

Default

true (for all sub properties)

There are several restrictions in TYPO3, which filter records by certain constraints.

disabled
Adds a checkbox to hide the record in the frontend.
startTime
Adds a date picker to set the start time when to display the record.
endTime
Adds a date picker to set the end time when to stop displaying the record.
userGroup
Adds a selection to choose user groups, which are allowed to view the record.
restriction:
  disabled: false
  startTime: true
  endTime: true
  userGroup: false
Copied!
softDelete
Required

false

Type

boolean

Default

true

When deleting records in the TYPO3 backend, they are not really deleted in the database. They are merely flagged as deleted. Disabling this option, removes this safety net.

# records will be really deleted in the backend
softDelete: false
Copied!
trackCreationDate
Required

false

Type

boolean

Default

true

Tracks the timestamp of the creation date. Disabling this option removes this information.

trackCreationDate: false
Copied!
trackUpdateDate
Required

false

Type

boolean

Default

true

Tracks the timestamp of the last update. Disabling this option removes this information.

trackUpdateDate: false
Copied!
sortable
Required

false

Type

boolean

Default

true

Tracks the order of records. Arrows will appear to sort records explicitly. Disabling this option removes this functionality. This corresponds to the TCA option sortby.

sortable: false
Copied!
sortField
Required

false

Type

string|array

Default

true

The field identifier to use for sorting records. If set, this will disable the sortable option automatically. This corresponds to the TCA option default_sortby. It is possible to define multiple sorting fields with an array.

# simple sort by one field in ascending order
sortField: title

# sorting by multiple fields with different orders
sortField:
  - identifier: title
    order: desc
  - identifier: text
    order: asc
Copied!
internalDescription
Required

false

Type

boolean

Default

false

If enabled, this adds a new tab Notes with a description field. When filled with text, a record information will be displayed in the editing view. This corresponds with the TCA ctrl option descriptionColumn. This field is supposed to be used only for the backend.

internalDescription: true
Copied!
rootLevelType
Required

false

Type

string

Default

onlyOnPages

Restricts the place, where the record can be created. Possible values are onlyOnPages (default), onlyOnRootLevel and both. This corresponds to the TCA ctrl option rootLevel.

rootLevelType: 'onlyOnRootLevel'
Copied!
security
Required

false

Type

array

ignoreWebMountRestriction
default false, Allows users to access records that are not in their defined web-mount, thus bypassing this restriction.
ignoreRootLevelRestriction
default false, Allows non-admin users to access records that are on the root-level (page ID 0), thus bypassing this usual restriction.
ignorePageTypeRestriction
default false (but true if table is used as foreign_table), Allows to use the record on any kind of page type.
security:
    ignoreWebMountRestriction: true
    ignoreRootLevelRestriction: true
    ignorePageTypeRestriction: true
Copied!
readOnly
Required

false

Type

boolean

Default

false

If enabled, the record can not be edited in the TYPO3 backend anymore.

readOnly: true
Copied!
adminOnly
Required

false

Type

boolean

Default

false

If enabled, only admins can edit the record.

adminOnly: true
Copied!
hideAtCopy
Required

false

Type

boolean

Default

false

If enabled, the record will be disabled, when copied. Only works, if restriction.disabled is set to true.

hideAtCopy: true
Copied!
appendLabelAtCopy
Required

false

Type

string

If set, the label field labelField will be appended with this string, when copied.

appendLabelAtCopy: append me
Copied!