Issue Feature Closed

#100404Link-Selector-Popup in backend module should be extendable with custom link handlers

Anonymous 04/03/23, 10:29 updated 11/19/26, 08:04

Description

Currently you can create custom link handlers and register them through PageTS and they are available throughout the whole page tree.

But there seems no possibility to do the same for modules which do not depend on the page tree and therefore on PageTS, like EXT:redirects. Or I’m not able to find the documentation for that.

It would be great if the link selector popup inside the EXT:redirects backend module is also extendable with custom link handlers so one has the possibility to create redirects to detail pages for records for example.

Reviews 0

No change resolves or names this issue in its commit message, and no comment links one.

History 4

  1. Nikolas Hagelstein commented <span data-processor="relativetime" data-value="2023-07-13T09:45:46+00:00" > 07/13/23, 09:45 </span>

    Tobias Pinnekamp wrote:
    > Currently you can create custom link handlers and register them through PageTS and they are available throughout the whole page tree.
    >
    > But there seems no possibility to do the same for modules which do not depend on the page tree and therefore on PageTS, like EXT:redirects. Or I’m not able to find the documentation for that.
    >
    > It would be great if the link selector popup inside the EXT:redirects backend module is also extendable with custom link handlers so one has the possibility to create redirects to detail pages for records for example.

    Make sure you use TYPO3\CMS\Backend\LinkHandler as handler.
    There is alsoe a regression. This used to work in TYPO3v11. See #101344 :)

  2. Peter Kraume commented <span data-processor="relativetime" data-value="2023-12-06T21:21:25+00:00" > 12/06/23, 21:21 </span>

    For me, the custom link handler for records works (in TYPO3 11.5.33). Here is a configuration example:

    TCEMAIN.linkHandler {
      references {
        handler = TYPO3\CMS\Recordlist\LinkHandler\RecordLinkHandler
        label = LLL:EXT:references/Resources/Private/Language/locallang.xlf:linkHandler.tab.references
        configuration {
          table = tx_references_domain_model_reference
          storagePid = 12345
          hidePageTree = 1
        }
      }
    }

    Important is, that the storagePid is hard coded in TSConfig because using constants, e.g. from the site configuration, don’t work here.

  3. Benni Mack commented and changed status New Closed <span data-processor="relativetime" data-value="2026-11-19T08:04:57+00:00" > 11/19/26, 08:04 </span>

    This works with the current Core, no code change needed.

    The link browser reads its handlers from the page TSconfig of the page the record is on. sys_redirect records are usually stored on pid 0, where only the global page TSconfig applies: the Configuration/page.tsconfig of every extension, plus $GLOBALS['TYPO3_CONF_VARS']['BE']['defaultPageTSconfig']. A link handler registered there shows up in the link browser of the Redirects module, too.

    Example for EXT:my_sitepackage/Configuration/page.tsconfig:

    TCEMAIN.linkHandler.tx_news {
      handler = TYPO3\CMS\Backend\LinkHandler\RecordLinkHandler
      label = News
      configuration {
        table = tx_news_domain_model_news
        storagePid = 42
        hidePageTree = 1
      }
      scanAfter = page
    }
    • handler is TYPO3\CMS\Backend\LinkHandler\RecordLinkHandler since v12 (formerly in EXT:recordlist).
    • storagePid must be a fixed number. Page TSconfig from a site or site set does not reach pid 0, so site settings and constants are not available there.
    • scanAfter = page makes the link browser detect existing t3://record links as this handler.

    The redirect needs the matching frontend TypoScript with the same identifier to resolve the record link:

    config.recordLinks.tx_news {
      typolink {
        parameter = 17
        additionalParams.data = field:uid
        additionalParams.wrap = &tx_news_pi1[action]=detail&tx_news_pi1[news]=|
      }
    }

    To configure the handlers in PHP instead (for example, depending on the site), use the PSR-14 event \TYPO3\CMS\Backend\Controller\Event\ModifyLinkHandlersEvent (since v12).

    The regression mentioned above (#101344) has been fixed. I am closing this issue. Site-dependent link handler configuration for records on pid 0 would be a separate feature request.