如何扩展TypoLink生成函数,使其在每次生成TypoLink时都会检查某个targetpId,然后将当前页面的id作为GEt参数追加。例如:
When a Link on the page with ID 5 targets the page with the ID 19 then add ?ref=5 to the link我现在不知道从哪里开始,我可以尝试重写哪个类/方法来包含这种行为。
发布于 2019-06-19 15:50:11
我不知道TYPO3 9.5,但我们在8.7中做到了。下面是我们使用的扩展类的一个片段:
$GLOBALS['TYPO3_CONF_VARS']['SYS']['Objects'][TYPO3\CMS\Frontend\Page\PageRepository::class] = array(
'className' => Vendor\Extension\Page\PageRepository::class
);
$GLOBALS['TYPO3_CONF_VARS']['SYS']['Objects'][TYPO3\CMS\Frontend\ContentObject\ContentObjectRenderer::class] = array(
'className' => Vendor\Extension\ContentObject\ContentObjectRenderer::class
);
$GLOBALS['TYPO3_CONF_VARS']['SYS']['Objects'][TYPO3\CMS\Core\DataHandling\DataHandler::class] = array(
'className' => Vendor\Extension\DataHandling\DataHandler::class
);
$GLOBALS['TYPO3_CONF_VARS']['SYS']['Objects'][TYPO3\CMS\Frontend\Typolink\PageLinkBuilder::class] = array(
'className' => Vendor\Extension\Typolink\PageLinkBuilder::class
);这并不是你正在寻找的东西,但却是一个很好的开始。
https://stackoverflow.com/questions/56652851
复制相似问题