简体   繁体   中英

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"'

But since 8.7 LTS typolinks are formatted like "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.

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. It works for me, as long the uid refers to a valid page. When the uid is not valid, only the text is renderd without any link.

The new format is also documented as an example in 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><a href="t3://page?uid=23">my link</a></f:format.html>

Result:

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM