I've got this weird issue with Sitecore 9.2. I'm building a multi-lingual site and require the language code to always appear in URLs. I've configured this on the link provider as follows:

<add name="custom" type="custom.Feature.ItemResolver.LinksProvider.CustomLinksProvider, custom.Feature.ItemResolver" 
                     patch:before="add[@type='Sitecore.Links.LinkProvider, Sitecore.Kernel']" />

With languageEmbedding set to "always", The experience editor fails for all languages other than Global English (the default language for the site). It seems the site resolving does not work, as it appends sc_site=website on the end of the EE URL, which causes it to fail. If I change website to the correct site name, it works.

UPDATE: When I say EE fails, this is what I see: enter image description here

All the correct components are on the page, and they have datasources defined, however they don't seem to render anything.

With languageEmbedding set to "asNeeded", Experience Editor works fine, however the link provider is not adding the language code to the URL.

Smells like a Sitecore bug to me.. anyone else experienced this, or found a workaround? I'll be raising a support request with Sitecore about this soon, but figured I'd try here first and save myself some time and frustration.

Thanks heaps :)

  • What do you mean by "it falil on EE" ? What is the error you getting? Mar 10, 2020 at 15:54
  • Actually it doesn't through an error or anything, it just shows a page with all the shared components but without any data sources rendered. Strangely, if i edit the contents of any of those components, they have data sources and content, however they don't render in EE. If i change the sc_site querystring to match the site name, it works fine.
    – Jeeby
    Mar 11, 2020 at 1:45
  • And what happens if you disable your custom LinkProvider, and set LanguageEmbedding=always on the default Sitecore LinkProvider?
    – jammykam
    Mar 11, 2020 at 3:16
  • That's an excellent idea @jammykam, i'll give that a go shortly.
    – Jeeby
    Mar 11, 2020 at 3:36
  • Same behaviour with my custom ItemResolver and LinkManager disabled, and languageEmbedding="always" on the site definition. Without the languageEmbedding="always", it works.
    – Jeeby
    Mar 11, 2020 at 7:22


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.