TYPO3 9.5中Fluid Typolink ViewHelper忽略additionalParams属性问题咨询
Ah, I've run into this exact quirk with TYPO3 9.5's f:link.typolink before! The issue here is that the additionalParams attribute is designed primarily for internal TYPO3 page links (like linking to a page ID with extension parameters), and it won't automatically append parameters to external URLs passed in the parameter field.
Here are the straightforward solutions to get your external link working with parameters:
1. Manually Append Parameters to the External URL
The simplest fix is to directly include your parameters in the parameter value itself. Just format it like a regular external URL:
<f:link.typolink parameter="www.test-link.de?u=b"> Linktext </f:link.typolink>
If you need multiple parameters, chain them with & as usual:
<f:link.typolink parameter="www.test-link.de?u=b&source=typo3"> Linktext </f:link.typolink>
2. Dynamically Add Parameters (For Variables)
If your parameter value comes from a Fluid variable, you can concatenate it directly in the parameter attribute. Just make sure to handle URL encoding if needed:
<!-- Assuming {userIdentifier} is your dynamic variable --> <f:link.typolink parameter="www.test-link.de?u={userIdentifier}"> Linktext </f:link.typolink>
For safer URL encoding of the parameter value, use the f:uri.url view helper:
<f:link.typolink parameter="www.test-link.de?u={f:uri.url(value: userIdentifier)}"> Linktext </f:link.typolink>
Why Your Original Code Didn't Work
To clarify: When you pass an external URL to parameter, TYPO3's underlying typolink processing treats it as a raw external target and ignores the additionalParams attribute—this attribute is reserved for adding query parameters to internal TYPO3 page routes (e.g., parameter="123" for page ID 123, plus additionalParams="&tx_myext[view]=list").
内容的提问来源于stack exchange,提问作者Achim Strohm

