Relation
The
Relation type can handle relations to other record types. They will
be available to select from the Record Selector.
Settings
| Name | Type | Default | Required |
|---|---|---|---|
| string (table name, comma-separated) | true | ||
| integer | |||
| integer | |||
| string | oneToMany | ||
| integer | |||
| boolean | false | ||
| string|integer | |||
| array | |||
| object | |||
| object | |||
| object | |||
| object | |||
| array | |||
| string | |||
| boolean | |||
| boolean | |||
| boolean | |||
| boolean | |||
| string | |||
| object | |||
| string | |||
| object | |||
| string | |||
| boolean | false | ||
| boolean | |||
| boolean | false | ||
| integer | 1 | ||
| object |
allowed
-
- Type
- string (table name, comma-separated)
- Required
true
One or more tables, that should be referenced.
This table can be defined by another Content Block, but can also be an existing table defined by the Core or another extension.
maxitems
-
- Type
- integer
Maximum number of items. Defaults to a high value. JavaScript record validation prevents the record from being saved if the limit is not satisfied.
minitems
-
- Type
- integer
Minimum number of items. Default is no minimum. JavaScript record validation prevents the record from being saved if the limit is not satisfied. The field can be set as required by setting
minitemsto at least 1.
relationship
-
- Type
- string
- Default
- oneToMany
The relationship defines the cardinality between the relations. Possible values are
one(default),To Many manyandTo One one. In case of a [x]toOne relation, the processed field will be filled directly with the record instead of a collection of records. In addition,To One maxitemswill be automatically set to1.
autoSizeMax
-
- Type
- integer
The field will never grow larger than this number of visible rows.
behaviour.allowLanguageSynchronization
-
- Type
- boolean
- Default
- false
Allows to select if localization uses custom or default language value.
default
-
- Type
- string|integer
Default value set if a new record is created.
dontRemapTablesOnCopy
-
- Type
- array
A list of tables which should not be remapped to the new element uids if the field holds elements that are copied in the session.
elementBrowserEntryPoints
-
- Type
- object
Changes the default starting point when opening the element browser. Use the key
_defaultto set the default page uid.Example:
elementBrowserEntryPoints: _default: 42Copied!
fieldControl
-
- Type
- object
Enables or disables individual controls next to the field. Each control accepts a
disabledboolean. Available controls:add,Record edit,Popup list,Module element,Browser insert.Clipboard See TCA fieldControl.
fieldInformation
-
- Type
- object
See TCA fieldInformation.
fieldWizard
-
- Type
- object
See TCA fieldWizard.
filter
-
- Type
- array
Defines filters for item values. Each entry requires a
userkey and an optionalFunc parametersobject. Does not work in combination with a wizard.
foreign_table
-
- Type
- string
Restricts selectable records to a specific table. Can be used instead of or together with
allowed.
hideDeleteIcon
-
- Type
- boolean
Removes the delete icon next to the selector box.
hideMoveIcons
-
- Type
- boolean
Removes the move icons next to the selector box.
hideSuggest
-
- Type
- boolean
Disables the suggest (autocomplete) wizard.
localizeReferencesAtParentLocalization
-
- Type
- boolean
Defines whether referenced records should be localized when the current record gets localized. Only applies if references are not stored using MM tables.
MM
-
- Type
- string
Table name for storing the MM relation. Used together with
foreign_.table
MM_match_fields
-
- Type
- object
Field-value pairs to both insert and match against when writing/reading MM relations.
MM_opposite_field
-
- Type
- string
Enables bidirectional MM relations. Set to the field name on the local side when configuring the foreign side.
MM_oppositeUsage
-
- Type
- object
Required on the opposite side of a bidirectional MM relation that uses match fields.
MM_table_where
-
- Type
- string
Additional WHERE clause used when reading MM relations.
multiple
-
- Type
- boolean
- Default
- false
Allows the same record to be selected more than once in the list.
prepend_tname
-
- Type
- boolean
When enabled, the table name is prepended to the stored relation uids.
readOnly
-
- Type
- boolean
- Default
- false
Renders the field in a way that the user can see the value but cannot edit it.
size
-
- Type
- integer
- Default
- 1
Number of visible rows in the selector box. A value of 1 displays a drop-down.
suggestOptions
-
- Type
- object
Configuration for the suggest (autocomplete) wizard. Keys are table names or
defaultto apply to all tables. Each entry supports:- additionalSearchFields (string)
- Comma-separated list of extra fields to search in.
- addWhere (string)
- Additional WHERE clause appended to the search query.
- cssClass (string)
- CSS class added to every result list item.
- maxItemsInResultList (integer, default 10)
- Maximum number of results to display.
- maxPathTitleLength (integer)
- Maximum characters shown for a path element.
- minimumCharacters (integer)
- Minimum characters required to trigger the search.
- orderBy (string)
- ORDER BY clause for the search query.
- pidList (string)
- Comma-separated page uids to limit the search scope.
- pidDepth (integer)
- Number of sub-page levels to expand from
pid.List - receiverClass (string)
- Alternative PHP receiver class for the suggest wizard.
- renderFunc (string)
- User function to manipulate the displayed results.
- searchCondition (string)
- Additional WHERE clause (not prepended with AND).
- searchWholePhrase (boolean)
- Searches for the whole phrase rather than only the beginning.
Example:
suggestOptions: default: additionalSearchFields: 'nav_title, url' addWhere: 'AND pages.doktype = 1' minimumCharacters: 2Copied!
Examples
Minimal
name: example/relation
fields:
- identifier: record_select
type: Relation
allowed: 'some_table'
Advanced / use case
name: example/relation
fields:
- identifier: page_select
type: Relation
allowed: 'pages'
maxitems: 1
suggestOptions:
default:
additionalSearchFields: 'nav_title, url'
addWhere: 'AND pages.doktype = 1'