Fluid Typolink ViewHelper ignores additionalParams-attribute

1.1k views Asked by At

I want to create a link to an external page with parameters via the f:link.typolink-ViewHelper. The ViewHelper creates the link but without my parameters. I've used an example from the TYPO3 documentation (https://docs.typo3.org/other/typo3/view-helper-reference/9.5/en-us/typo3/fluid/latest/Link/Typolink.html). I'm using TYPO3 9.5. Do I need some further configuration?

<f:link.typolink parameter="www.test-link.de" additionalParams="&u=b">
   Linktext
</f:link.typolink>
2

There are 2 answers

0
Vikram On

It can work without additionalParams

<f:link.typolink parameter="www.test-link.de?u=b" >
   Linktext
</f:link.typolink>

FYI, additionalParams was not working of me as well. So I did the above

Update: There is documentation error at https://docs.typo3.org/other/typo3/view-helper-reference/10.4/en-us/typo3/fluid/latest/Link/Typolink.html

Way to do it is as suggested by @Scopestyle

0
Scopestyle On

The correct way to write this would be:

additionalParams="{name: 'value'}"

You can even combine multiple parameters like this:

additionalParams="{name: 'value', anotherName: 'anotherValue'}"