typo3 - 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小部件以新方式工作 - 不再有可能获得旧语法。
任何想法如何处理视图助手中的现代错字链接?
谢谢!
解决方案
我已经 <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>
推荐阅读
- r - R:列表的元素到相应的数据框行
- arduino - FastLED 闪烁 - 使用 millis() 无延迟地改变颜色
- multithreading - 线程什么时候死?
- b-tree - B-tree minimum internal children count 解释
- mysql - MYSQL LOAD DATA IN FILE 并将 LAST_INSERT_ID 和 INSERT DATA 放入另一个表
- django - 无法从与一对多关系关联的模型中获取模板中的数据
- git - 远程分支在 sourcetree 中可以为空 ( '' ) 还是错误?
- python - 从工作目录中的文件夹导入另一个 py 文件
- arrays - 前 K 个子集总和,没有排序
- elixir - 在 Elixir 中按内部映射值查找键