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 v11 here: TYPO3 ELTS.
The RecordLinkHandler
The Record
enables editors to link to single records, for
example the detail page of a news record.
You can find examples here:
The handler is implemented in class \TYPO3\
of the system extension backend
. The class is marked as
@internal
and contains neither hooks nor events.
In order to use the RecordLinkHandler it can be configured as following:
-
Page TSconfig is used to create a new tab in the LinkBrowser to be able to select records.
TCEMAIN.linkHandler.anIdentifier { handler = TYPO3\CMS\Recordlist\LinkHandler\RecordLinkHandler label = LLL:EXT:extension/Resources/Private/Language/locallang.xlf:link.customTab configuration { table = tx_example_domain_model_item } scanAfter = page }
Copied!You can position your own handlers in order as defined in the LinkBrowser API.
The links are now stored in the database with the syntax
<a href="t3://
.record?identifier=an Identifier&uid=456">A link</ a> -
TypoScript configures how the link will be displayed in the frontend.
config.recordLinks.anIdentifier { // Do not force link generation when the record is hidden forceLink = 0 typolink { parameter = 123 additionalParams.data = field:uid additionalParams.wrap = &tx_example_pi1[item]=|&tx_example_pi1[controller]=Item&tx_example_pi1[action]=show } }
Copied!Important
Do not change the identifier after links have been created using the RecordLinkHandler. The identifier will be stored as part of the link in the database.
RecordLinkHandler page TSconfig options
The minimal page TSconfig configuration is:
TCEMAIN.linkHandler.anIdentifier {
handler = TYPO3\CMS\Recordlist\LinkHandler\RecordLinkHandler
label = LLL:EXT:extension/Resources/Private/Language/locallang.xlf:link.customTab
configuration {
table = tx_example_domain_model_item
}
}
The following optional configuration is available:
configuration.
hide Page Tree = 1 - Hide the page tree in the link browser
configuration.
storage Pid = 84 - The link browser starts with the given page
configuration.
page Tree Mount Points = 123,456 - Only records on these pages and their children will be displayed
Furthermore the following options are available from the LinkBrowser Api:
configuration.
orscan After = page configuration.
scan Before = page - Define the order in which handlers are queried when determining the responsible tab for an existing link
configuration.
ordisplay Before = page configuration.
display After = page - Define the order of how the various tabs are displayed in the link browser.
LinkHandler TypoScript options
A configuration could look like this:
config.recordLinks.anIdentifier {
forceLink = 0
typolink {
parameter = 123
additionalParams.data = field:uid
additionalParams.wrap = &tx_example_pi1[item]=|
}
}
The TypoScript Configuration of the LinkHandler is being used in sysext frontend
in class \TYPO3\
.