[英]Viewhelper f:link.typolink in TYPO3 9.5 LTS
The viewhelper视图助手
<f:link.typolink parameter="{link}">
works only with strings like '19 _blank - "testtitle with whitespace"'仅适用于像 '19 _blank - "testtitle with whitespace"' 这样的字符串
But since 8.7 LTS typolinks are formatted like "t3://page?uid=4284".但由于 8.7 LTS 打字链接的格式类似于“t3://page?uid=4284”。 This works:
这有效:
<f:link.typolink parameter="4284">
this dont:这不:
<f:link.typolink parameter="t3://page?uid=4284">
but the typolink widgets works the new way - there is no possiblity anymore to get the old syntax.但是typolink 小部件以新的方式工作 - 不再有可能获得旧的语法。
Any ideas how to deal with a modern typolink in a viewhelper?任何想法如何处理视图助手中的现代拼写链接?
Thanks!谢谢!
I have tested <f:link.typolink parameter="t3://page?uid=23">test</f:link.typolink>
on TYPO3 9.5.3.我已经在 TYPO3 9.5.3 上测试了
<f:link.typolink parameter="t3://page?uid=23">test</f:link.typolink>
。 It works for me, as long the uid refers to a valid page.它对我有用,只要 uid 指的是有效页面。 When the uid is not valid, only the text is renderd without any link.
当 uid 无效时,仅呈现文本而没有任何链接。
The new format is also documented as an example in TyposcriptReference: Typolink .新格式也在TyposcriptReference: Typolink 中作为示例进行了记录。
It should work.它应该工作。
Valid uid:有效用户名:
<f:link.typolink parameter="t3://page?uid=23">test</f:link.typolink>
Result:结果:
<a href="/test.html">test </a>
Wrong uid:错误的用户名:
<f:link.typolink parameter="t3://page?uid=9999999">test</f:link.typolink>
Result:结果:
test
Alternative with <f:format.html>
:替代
<f:format.html>
:
<f:format.html><a href="t3://page?uid=23">my link</a></f:format.html>
Result:结果:
<a href="/test.html">my link</a>
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.