Attention
TYPO3 v11 has reached end-of-life as of October 31th 2024 and is no longer being maintained. Use the version switcher on the top left of this page to select documentation for a supported version of TYPO3.
Need more time before upgrading? You can purchase Extended Long Term Support (ELTS) for TYPO3 v10 here: TYPO3 ELTS.
relationship
relationship
-
- Type
- string
- Path
- $GLOBALS['TCA'][$table]['columns'][$field]['config']
- Scope
- Display / Proc.
- RenderType
- all
- Default
- manyToMany
All possible values are:
oneTo One - Stores the uid of the selected category. When using this
relationship,
maxitems=1will automatically be added to the column configuration. While one record can only have a relation to one category, each category can still have a relationship to more then one record. oneTo Many - Stores the uids of selected categories in a comma-separated list.
many(default):To Many - Uses the intermediate table
sys_and only stores the categories count on the local side. This is the use case, which was previously accomplished usingcategory_ record_ mm Extension.Management Utility->make Categorizable ()
In the following example a category tree is displayed, but only one category can be selected.
$GLOBALS['TCA'][$myTable]['columns']['mainCategory'] = [ 'config' => [ 'type' => 'category', 'relationship' => 'oneToOne' ] ];Copied!All other relevant options, for example
maxitems=1, are being set automatically.