Issue Feature Closed

#92844Custom handling of links to additional doktypes

Mathias Bolt Lesniak 11/16/20, 08:48 updated 10/03/26, 04:45

Description

It would be useful to be able to handle links are for custom doktypes in a custom way. I suggest extending this condition (see link below) through a PSR-14 event that allows custom link generation if necessary.

https://github.com/TYPO3-CMS/frontend/blob/48363a9e3a77f516d2e60a3021d4293899d69146/Classes/Typolink/PageLinkBuilder.php#L221

            if ((int)$page['doktype'] === PageRepository::DOKTYPE_LINK) {
                $conf['parameter'] = $page['url'];
                unset($conf['parameter.']);
                $this->contentObjectRenderer->typoLink($linkText, $conf);
                $target = $this->contentObjectRenderer->lastTypoLinkTarget;
                $url = $this->contentObjectRenderer->lastTypoLinkUrl;
                if (empty($url)) {
                    throw new UnableToLinkException('Link to external page "' . $page['uid'] . '" does not have a proper target URL, so "' . $linkText . '" was not linked.', 1551621999, null, $linkText);
                }
            }

I would be happy to implement this feature.

Reviews 0

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

History 2

  1. Georg Ringer commented and changed status New Closed <span data-processor="relativetime" data-value="2026-10-03T04:45:52+00:00" > 10/03/26, 04:45 </span>

    closing this issue as code changed a lot:

    • Doktype Link now supports all links
    • Events like ModifyPageLinkConfigurationEvent and AfterLinkIsGeneratedEvent can be used to modify the link