Five New Optimizely Certifications are Here! Validate your expertise and advance your career with our latest certification exams. Click here to find out more
Five New Optimizely Certifications are Here! Validate your expertise and advance your career with our latest certification exams. Click here to find out more
Hi,
Did you already try publishing to /epi/shell/context/request
?
There is some information in the documentation here: https://world.episerver.com/documentation/developer-guides/CMS/user-interface/Context-sensitive-components/#ChangeCurrentContext
Yes, even with a language-specific id like publish("/epi/shell/context/request", [{ uri: "epi.cms.contentdata:///5_276" }])
I can see xhr calls to /EPiServer/cms/Stores/contentstructure/5
and /EPiServer/cms/Stores/contentstructure/?referenceId=5&query=getchildren&typeIdentifiers=episerver.core.pagedata
which leads me to EPiServer.Cms.Shell.UI.Rest.Internal.ContentStore
(gist)
The language is resolved (i think) with this line: parameters1.PreferredCulture = allLanguages.Value ? null : this._languageResolver.GetPreferredCulture();
which in turn uses ContentLanguage.PreferredCulture.
Hi
I'm using a epi-cms/widget/ContentSelector outside standard CMS context, inpsired by https://gist.github.com/mvirkkunen/10484486. This works fine when using only one language.
The problem is I want to control the language-filter in the selector. If I understood the underlying mechanisms correctly, the widget itself has no control over this, but rather is determined server-side in the REST-store.
If I change language in edit mode, e.g. go to /EPiServer/CMS/?language=xxx, the selected language is reflected in my selector. This led me down the disassembly path, and ultimately to calls such as:
SystemLanguage.Instance.SetCulture("xx")
ContentLanguage.Instance.SetCulture("xx")
ContentLanguage.PreferredCulture = culturexx
ContextCache.Current["EPiServer:ContentLanguage"] = culturexx
None of these methods made any difference when called from my controller, in all thinkable extension points.
Neither did trying to publish to dojo topics such as "/epi/shell/context/updateRequest" or "/epi/cms/action/viewsettingvaluechanged"
Any pointers in the right direction would be greatly appreciated