Link Handler
Link handlers in TYPO3 allow editors to create links to specific records directly from the link browser in the backend. This is particularly useful when you want to link to individual records that are displayed through the Anthology extension.
Overview
When you configure a link handler for your model, editors can:
- Select records directly from the link browser
- Create links that automatically route to the single view of a record
- Maintain links even if the record moves or changes
The link handler consists of two parts:
- Backend Configuration (
page.) - Enables the link browser tabtsconfig - Frontend Configuration (
setup.) - Defines how links are renderedtyposcript
Backend Configuration
Add this configuration to your page. to enable the link browser for your model:
TCEMAIN.linkHandler {
tx_myextension_domain_model_item {
handler = TYPO3\CMS\Backend\LinkHandler\RecordLinkHandler
label = Model name
configuration {
table = tx_myextension_domain_model_item
storagePid = 123
hidePageTree = 1
}
scanAfter = page
}
}
Copied!
Configuration Options
handler- The PHP class handling the link browser functionality. Required
label- Display name in the link browser tab. Required
table- Database table name of your model. Required
storagePid- Page ID where records are stored (0 for all pages).
hidePageTree- Hide the page tree in link browser (1 = hide, 0 = show).
scanAfter- Position of the tab in link browser.
Frontend Configuration
Configure how the links are rendered in the frontend by adding this to your setup.:
config.recordLinks.tx_myextension_domain_model_item {
forceLink = 0
typolink {
parameter = 123
additionalParams.data = field:uid
additionalParams.wrap = &tx_llanthology_anthologyview[record]=|&tx_llanthology_anthologyview[controller]=Anthology&tx_llanthology_anthologyview[action]=single
}
}
Copied!
Configuration Options
forceLink- Force link generation even if target page doesn't exist. Default:
0 parameter- Target page ID where Anthology plugin is configured. Required
additionalParams.data- Data source for the record identifier. Default:
field:uid additionalParams.wrap- URL parameters to append. See example above.
Usage in Backend
Once configured, editors can:
- Open the link browser in any RTE field
- Click on the "Products" tab (or your configured label)
- Browse and select records from the configured storage page
- The link will automatically point to the single view
Troubleshooting
Link Handler Tab Not Appearing
- Check that
page.is properly loadedtsconfig - Verify the table name matches your model exactly
- Ensure the storage PID exists and contains records
Links Not Working
- Verify the target page ID in
parameterhas the Anthology plugin - Check that the repository is configured in
plugin.tx_ llanthology. settings. repositories - Ensure routing is properly configured for clean URLs
No Records Showing
- Check the
storageconfigurationPid - Verify records exist on the specified page
- Use
storageto search all pagesPid = 0
Advanced Configuration
Multiple Storage Pages
TCEMAIN.linkHandler {
tx_myextension_domain_model_item {
handler = TYPO3\CMS\Backend\LinkHandler\RecordLinkHandler
label = Items
configuration {
table = tx_myextension_domain_model_item
storagePid = 10,20,30
hidePageTree = 1
}
scanAfter = page
}
}
Copied!