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.tsconfig) - Enables the link browser tab - Frontend Configuration (
setup.typoscript) - Defines how links are rendered
Backend Configuration
Add this configuration to your page.tsconfig 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
| Option | Description | Required |
|---|---|---|
handler | The PHP class handling the link browser functionality | Yes |
label | Display name in the link browser tab | Yes |
table | Database table name of your model | Yes |
storagePid | Page ID where records are stored (0 for all pages) | No |
hidePageTree | Hide the page tree in link browser (1 = hide, 0 = show) | No |
scanAfter | Position of the tab in link browser | No |
Frontend Configuration
Configure how the links are rendered in the frontend by adding this to your setup.typoscript:
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
| Option | Description | Default |
|---|---|---|
forceLink | Force link generation even if target page doesn't exist | 0 |
parameter | Target page ID where Anthology plugin is configured | Required |
additionalParams.data | Data source for the record identifier | field:uid |
additionalParams.wrap | URL parameters to append | See example |
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.tsconfigis properly loaded - 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
storagePidconfiguration - Verify records exist on the specified page
- Use
storagePid = 0to search all pages
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!