0
votes

Any versioned Media Library Images which don't have a "en" version will 404 and not show up when in Sitecore Page Editing mode as they appear to have "/sitecore/shell" prepended before "-/media/".

If "/sitecore/shell" is removed the images render fine. The images render when the "sc_lang" parameter is added as well. How can I have the page editor properly append the language when it's language is different from the context language?

1
Are you using sc:image or sc:fieldrenderer controls? What is the context language and why do you want to display a different language image? Is there some logic about what the language should be?jammykam
Using GlassMapper RenderImage. The context language of the page is en-US where as the Sitecore Shell is en. The image doesn't have an en version, only a en-US version for now and will only render when in the Page Editor if I manually append the sc_lang parameter to the image path. This works perfectly when you're not logged in to Sitecore.benadamski

1 Answers

0
votes

The behavior you describe cannot be reproduced unless you mess around with the context language somewhere in your own code. If I request a page in 'en-US' then all items are fetched with that language unless I specifically say that I want to use another language or if I specifically say the Context.Language is something else (and from that point on the language is changed, anything loaded before that will be in original language).

Another explanation could be that your page has both 'en-US' and 'en' version, but that would not explain why an img element is rendered at all.

When accessing page editor from publish tab in Content Editor the sc_lang param is already added. When accessing page editor as application at login screen the Default Content Language for the user is applied. I set content language to 'en-US' for admin and now the application starts with en-US for me. This might also be a solution for you though I think some tampering with the language is what's really bugging you here.