TYPO3 Logo
TYPO3 Core Changelog
Options
Give feedback View source How to edit Edit on GitHub Full documentation (single file)

TYPO3 Core Changelog

  • ChangeLog v14
    • 14.0 Changes
    • 14.x Changes by type
  • ChangeLog v13
    • 13.4.x Changes
    • 13.4 Changes
    • 13.3 Changes
    • 13.2 Changes
    • 13.1 Changes
    • 13.0 Changes
    • 13.x Changes by type
  • ChangeLog v12
    • 12.4.x Changes
    • 12.4 Changes
    • 12.3 Changes
    • 12.2 Changes
    • 12.1 Changes
    • 12.0 Changes
    • 12.x Changes by type
  • ChangeLog v11
    • 11.5.x Changes
    • 11.5 Changes
    • 11.4 Changes
    • 11.3 Changes
    • 11.2 Changes
    • 11.1 Changes
    • 11.0 Changes
    • 11.x Changes by type
  • ChangeLog v10
    • 10.4.x Changes
    • 10.4 Changes
    • 10.3 Changes
    • 10.2 Changes
    • 10.1 Changes
    • 10.0 Changes
    • 10.x Changes by type
  • ChangeLog v9
    • 9.5.x Changes
    • 9.5 Changes
    • 9.4 Changes
    • 9.3 Changes
    • 9.2 Changes
    • 9.1 Changes
    • 9.0 Changes
    • 9.x Changes by type
  • ChangeLog v8
    • 8.7.x Changes
    • 8.7 Changes
    • 8.6 Changes
    • 8.5 Changes
    • 8.4 Changes
    • 8.3 Changes
    • 8.2 Changes
    • 8.1 Changes
    • 8.0 Changes
    • 8.x Changes by type
  • ChangeLog v7
    • 7.6.x Changes
    • 7.6 Changes
    • 7.5 Changes
    • 7.4 Changes
    • 7.3 Changes
    • 7.2 Changes
    • 7.1 Changes
    • 7.0 Changes
    • 7.x Changes by type
  • Documenting Changes
  • Sitemap
  1. TYPO3 Core Changelog
  2. ChangeLog v12
  3. 12.0 Changes
  4. Feature: #97159 - New TCA type "link"
Give feedback Edit on GitHub

Feature: #97159 - New TCA type "link"

See forge#97159

Description

Especially TCA type input has a wide range of use cases, depending on the configured renderType and the eval options. Determination of the semantic meaning is therefore usually quite hard and often leads to duplicated checks and evaluations in custom extension code.

In our effort of introducing dedicated TCA types for all those use cases, the TCA type link has been introduced. It replaces the renderType=inputLink of TCA type input.

The TCA type link features the following column configuration:

  • allowedTypes
  • appearance: enableBrowser, browserTitle, allowedOptions, allowedFileExtensions
  • autocomplete
  • behaviour: allowLanguageSynchronization
  • default
  • fieldControl
  • fieldInformation
  • fieldWizard
  • mode
  • nullable
  • placeholder
  • readOnly
  • required
  • search
  • size
  • valuePicker

Note

The soft reference definition softref=typolink is automatically applied to all TCA type link columns.

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.

The following column configurations can be overwritten by page TSconfig:

  • readOnly
  • size

The previously configured linkPopup field control is now integrated into the new TCA type directly. Additionally, instead of exclude lists ( [blindLink[Fields|Options]) the new type now use include lists. Those lists are furthermore no longer comma-separated, but PHP arrays, with each option as a separate value.

The replacement for the previously used blindLinkOptions option is the allowedTypes configuration. The blindLinkFields option is now configured via appearance[allowedOptions]. While latter only affects the display in the Link Browser, the allowedTypes configuration is also evaluated in the DataHandler, preventing the user from adding links of non-allowed types.

To allow all link types, skip the allowedTypes configuration or set it to ['*']. It's not possible to deny all types.

To allow all options in the Link Browser, skip the appearance[allowedOptions] configuration or set it to ['*']. To deny all options in the Link Browser, set the appearance[allowedOptions] configuration to [] (empty array).

The allowedExtensions option is renamed to allowedFileExtensions and also moved to appearance. Now it requires to be an array. To allow all extensions, skip the appearance[allowedFileExtensions] configuration or set it to ['*']. It's not possible to deny all extensions.

With appearance[browserTitle], a custom title for the Link Browser can be defined. To disable the Link Browser, appearance[enableBrowser] has to be set to false.

A complete migration from renderType=inputLink to type=link looks like the following:

 // Before

 'a_link_field' => [
     'label' => 'Link',
     'config' => [
         'type' => 'input',
         'renderType' => 'inputLink',
         'required' => true,
         'nullable' => true,
         'size' => 20,
         'max' => 1024,
         'eval' => 'trim',
         '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,
         'nullable' => true,
         'size' => 20,
         'allowedTypes' => ['page', 'url', 'record'],
         'appearance' => [
             'enableBrowser' => false,
             'browserTitle' => 'Browser title',
             'allowedFileExtensions' => ['jpg', 'png'],
             'allowedOptions' => ['params', 'rel'],
         ],
     ]
 ]
Copied!

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 corresponding FormEngine class has been renamed from InputLinkElement to LinkElement. An entry in the "ClassAliasMap" has been added for extensions calling this class directly, which is rather unlikely. The extension scanner will report any usage, which should then be migrated.

Allowed type "record"

One of the primary tasks of the corresponding TCA migration is to migrate the exclude lists to include lists. To achieve this, the migration would need to know all possible values. Since the LinkHandler API provides the possibility to use the RecordLinkHandler as basis for various custom record types, whose availability however depends on the page context, it's not possible for the migration to add the custom record identifiers correctly. Therefore, the record type is added to the allowedTypes, enabling all custom record identifiers. The actually available identifiers are then resolved automatically in the link element, depending on the context.

To limit this in TCA already, replace the record value with the desired record identifiers.

// Before
'allowedTypes' => ['page', 'url', 'record'],

// After
'allowedTypes' => ['page', 'url', 'tx_news', 'tt_address'],
Copied!

Impact

It's now possible to simplify the TCA configuration by using the new dedicated TCA type link.

  • Previous
  • Next
Reference to the headline

Copy and freely share the link

This link target has no permanent anchor assigned. You can make a pull request on GitHub to suggest an anchor. The link below can be used, but is prone to change if the page gets moved.

Copy this link into your TYPO3 manual.

  • Home
  • Contact
  • Issues
  • Repository

Last rendered: May 20, 2025 09:23

© since 1997 by the TYPO3 contributors
  • Legal Notice
  • Privacy Policy