首页 > 解决方案 > TYPO3 9.5 LTS 中的 Viewhelper f:link.typolink

问题描述

视图助手

<f:link.typolink parameter="{link}">

仅适用于像 '19 _blank - "testtitle with whitespace"' 这样的字符串

但由于 8.7 LTS 错字链接的格式类似于“t3://page?uid=4284”。这有效:

<f:link.typolink parameter="4284">

这不:

<f:link.typolink parameter="t3://page?uid=4284">

但是typolink小部件以新方式工作 - 不再有可能获得旧语法。

任何想法如何处理视图助手中的现代错字链接?

谢谢!

标签: typo3typo3-9.x

解决方案


我已经 <f:link.typolink parameter="t3://page?uid=23">test</f:link.typolink>在 TYPO3 9.5.3 上进行了测试。只要 uid 引用有效页面,它就对我有用。当 uid 无效时,只渲染文本,没有任何链接。

TyposcriptReference: Typolink中也记录了新格式作为示例 。

它应该工作。

有效的 uid:

<f:link.typolink parameter="t3://page?uid=23">test</f:link.typolink>

结果:

<a href="/test.html">test </a>

错误的uid:

<f:link.typolink parameter="t3://page?uid=9999999">test</f:link.typolink>

结果:

test

替代<f:format.html>

<f:format.html><a href="t3://page?uid=23">my link</a></f:format.html>

结果:

<a href="/test.html">my link</a>

推荐阅读