[Neos] Language detection via url
Lars Peipmann
lars at peipmann.de
Fri May 9 10:38:58 CEST 2014
I have implemented this Flow-BlogPost of Steffen Ritter
http://blog.steffen-ritter.net/2014/04/language-detection-url-parameter-typo3-flow/
in my Neos 1.1-beta2 web site.
I've got two problems:
1) How to configure the "language" URL parameter in the Routes-Configuration (Routes.yaml) of Neos with "uriPattern: '<TYPO3NeosSubroutes>'"?
2) In my Neos 1.1-beta2 instance the cache ignores the language parameter.
clear cache > call a page: every output & link is correct
switch language in the URL on a cached page: page gets loaded from cache (without adjusting the output & links)
This is my language switch:
page.body.settings {
language = ${request.arguments.language}
}
<f:if condition="{settings.language} == 'en'">
<f:then>
<neos:link.node arguments="{language: 'de'}">Deutsch</neos:link.node>
</f:then>
<f:else>
<neos:link.node arguments="{language: 'en'}">English</neos:link.node>
</f:else>
</f:if>
Is this solution "ok"? Or is there a much better way to do that?
Best, Lars
More information about the Neos
mailing list