Link¶
New in version 12.0: The TCA type link
has been introduced. It replaces the
renderType=inputLink
option of TCA type input
.
New in version 13.0: When using the link
type, TYPO3 takes care of
generating the according database field.
A developer does not need to define this field in an extension's
ext_tables.sql
file.
The TCA type link
should be used to input values representing typolinks.
Example¶
A simple link field:
'a_link_field' => [
'label' => 'Link',
'config' => [
'type' => 'link',
'allowedTypes' => ['page', 'url', 'record'],
]
]
Migration¶
The previously configured linkPopup
field control is now integrated
into the new TCA type directly. Additionally, instead of exclude lists
(blindLink[Fields|Options]
), does the new type now use include lists.
Those lists are furthermore no longer comma separated, but PHP array
's,
with each option as a separate value.
The migration from renderType=inputLink
to type=link
is done like following:
// Before
'a_link_field' => [
'label' => 'Link',
'config' => [
'type' => 'input',
'renderType' => 'inputLink',
'required' => true,
'size' => 20,
'max' => 1024,
'eval' => 'trim,null',
'fieldControl' => [
'linkPopup' => [
'disabled' => true,
'options' => [
'title' => 'Browser title',
'allowedExtensions' => 'jpg,png',
'blindLinkFields' => 'class,target,title',
'blindLinkOptions' => 'mail,folder,file,telephone',
],
],
],
'softref' => 'typolink',
],
],
// After
'a_link_field' => [
'label' => 'Link',
'config' => [
'type' => 'link',
'required' => true,
'size' => 20,
'nullable' => 'true',
'allowedTypes' => ['page', 'url', 'record'],
'appearance' => [
'enableBrowser' => false,
'browserTitle' => 'Browser title',
'allowedFileExtensions' => ['jpg', 'png'],
'allowedOptions' => ['params', 'rel'],
],
]
]
An automatic TCA migration is performed on the fly, migrating all occurrences
to the new TCA type and triggering a PHP E_USER_DEPRECATED
error
where code adoption has to take place.
Note
The value of TCA type link
columns is automatically trimmed before
being stored in the database. Therefore, the eval=trim
option is no
longer needed and should be removed from the TCA configuration.