Try our conversational search powered by Generative AI!

Language aware ContentSelector widget



I'm using a epi-cms/widget/ContentSelector outside standard CMS context, inpsired by 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:
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

Edited, May 06, 2019 15:48


Did you already try publishing to /epi/shell/context/request?

There is some information in the documentation here:

Edited, May 06, 2019 19:49

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.

May 07, 2019 12:25
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.