Forum Discussion
It's a little harder to implement automatically, but you could probably more easily do a dropdown that sets a registered user's preference, but to persist an anonymous user's preferences, you'd have to get Khoros support to turn on
enable.PersistentAnonymousUserSettings = true
in your config.js file.
If you want to get a parameter from the url, since your CDN/rp rewrites everything, you can use
https://developer.khoros.com/khoroscommunitydevdocs/reference/url
to get the url and use the freemarker ?index_of to find what you're looking for in the string,
https://freemarker.apache.org/docs/ref_builtins_string.html#ref_builtin_index_of
for example, though a bit messy because it's in longhand, it'll work:
<#assign myUrl = "http://somewebsite.com/purple/my/lang/cues/en/hello-there"/>
<#assign myLangStart = myUrl?index_of("my/lang/cues/") />
<#assign myLangEnd = myLangStart+1 />
<#assign myLang = myUrl[myLangStart..myLangEnd] />
myUrl: ${myUrl}
myLangStart; ${myLangStart}
myLangEnd: ${myLangEnd}
myLang: ${myLang}
And then set the language via modifying the user setting through the API. I'll find the link for you tomorrow.
Related Content
- 9 days ago
- 13 years ago
- 10 years ago