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
A page in EPiServer is first created in the master language and all non global properties are saved on that page. Then all properties that are global are saved on the the different language versions of the page. So if you have non globalized properties they will be shown in the master language what ever you do.
"Unique value per language" is marked as Yes for each and every property in our pages, if that is what you mean?
Yes that was what I meant. That means that it shouldn't take any values from the master page unless there is a fallback in there somewhere. So if you leave all properties empty (except name) do you then get the master language property values?
I missed one key point - I'm referring to the text on links to pages that are not published!
To add to that, if I browse to a page that is not published for the current language, I still get the page with Master content, even though there is no fall-back set.
Can I turn this off?
No you can't turn this off what I know of. This is by design in this version of CMS. Normally this isn't a problem as you wouldn't show links to other languages because you filter the links with whatever language the user is currently on. They never see the links, they have to manually type them in.
A work-around:
if (EPiServer.Globalization.ContentLanguage.GetLanguageFromHost() != "en" && CurrentPage.IsMasterLanguageBranch)
Response.Redirect("/");
Hi Peter!
There's a bug which i think was fixed between CMS 6 and 6 R2 which would return the master language version of the page when trying to load a language that did not exist or was not published. Sounds like this might be the case. Should be fixed by upgrading to R2 when thats released.
Regards
Linus Ekström
sorry to pickup this old thread, but I'm seeing this in R2 too.
was this bug confirmed and fixed in R2?
Yes, it was fixed quite some while ago so the fix should should be included in CMS6 R2. Please contact support if you are still experiencing this.
the following piece of code can help:
if (!string.Equals(LanguageSelection.GetLanguageFromHost(), currentPage.LanguageID,
StringComparison.InvariantCultureIgnoreCase) &&
!isLanguageFallbackset)
{
Response.StatusCode = 404;
Server.Transfer("/404.aspx", false);
}
bool isLanguageFallbackset = GetFallbackLanguageId(CurrentPageLink);
public bool GetFallbackLanguageId(PageReference pageToCheck)
{
PageLanguageSetting pageLS;
pageLS = PageLanguageSetting.Load(pageToCheck, LanguageSelection.GetLanguageFromHost());
if (pageLS != null)
{
if (pageLS.LanguageBranchFallback.Length > 0)
return true;
}
return false;
}
The site host is mapped to en-IE and I've set en-IE to have no fall-back language and saved.
Is there anything else I need to do? I am getting Hungarian content on screen. Other languages seem to be functioning as expected.