Bug #98601
opentypolink with parameter "/"
0%
Description
the following viewhelper:
<f:link.typolink parameter="/" ></f:link.typolink>
results in an empty link <a class="">
This affects especially the language menus because the language data handler delivers "link: /" for the homepage in the default language.
In constructions like
<f:link.typolink parameter="{languagemenu.link}" ></f:link.typolink>
this results in empty links for the homepage in the default language.
Reason is a modification in typo3/systext/frontend/Classes/Service/TypoLinkCodecService.php. This line from Typo3 vs. 10:
$value = str_replace(['\\', '"'], ['\\\\', '\\"'], $value);
changes to:
$parts = str_replace(['\\\\', '\\"'], ['\\', '"'], str_getcsv($typoLink, static::$partDelimiter));
str_getcsv removes single slashes.
Updated by Chris Müller over 1 year ago
To circumvent this you can use just a plain "a" tag as the menu link has not to be processed via a view helper.
Updated by Benni Mack 10 months ago
- Status changed from New to Needs Feedback
Chris Müller wrote in #note-1:
To circumvent this you can use just a plain "a" tag as the menu link has not to be processed via a view helper.
I agree, I would do 100% the same: Using a menu "link" attribute again in a typolink will also double your DB requests for fetching the page again.
Maybe we need to update the docs for the menu processor / language menu processor that people should use <a> tags then.,
Updated by Philipp Kitzberger 7 months ago
Maybe the f:link.typolink
should even throw a warning (deprecation log?) when parameter
is starting with a slash?
"Don't put rendered pre-rendered stuff where it doesn't belong" ;-)
Updated by Benni Mack 5 months ago
Philipp Kitzberger wrote in #note-3:
Maybe the
f:link.typolink
should even throw a warning (deprecation log?) whenparameter
is starting with a slash?
People actually use it like this as well "/fileadmin/myfile.zip", how should we handle this then?