0
votes

I have created a site with multiple languages in sitecore... I the content editor (system > languages) I have specified three languages (Dutch, English and German). No I have 2 problems.

When an item has, for example: an English version but no German and Dutch version and I type the address to the German site: www.testsite.com/de I get the German site, but without content. In this case I want a 404 page to be shown.

Another problem is when I go to language that is not specified in system > language and also on the item is still get an empty site. In this case I also want a 404 page to be shown. Sitecore shows the page as long as it is a valid ISO-code.

I'm using Sitecore 6.4

Does anybody has a solution for these problem(s)?

Thanks in advance!

mrtentje

My LinkManager is specified as follows in the Web.config:

<add name="sitecore" type="Sitecore.Links.LinkProvider, Sitecore.Kernel" addAspxExtension="true" alwaysIncludeServerUrl="false" encodeNames="true" languageEmbedding="asNeeded" languageLocation="filePath" shortenUrls="true" useDisplayName="false"/>
2

2 Answers

0
votes

Unfortunately you have to manage both of these scenarios manually in Sitecore, they both have quite simple solutions but will require some development on your part.

For the first (accessing of pages without translations) I think you would need to extend the current ItemResolver within Sitecore and have it explicitly check that a version exists for the language that has been selected. I haven't implemented that myself but that's how I'd look at handling it.

The second (only accepting certain languages) is something I have handled, and it really bothered me that Sitecore couldn't handle it itself (though perhaps it does and I missed it). For this I created a step in the pipeline immediately after the LanguageResolver called PermissableLanguageChecker. This checks to see if the current language of the request is one of certain allowable values, and if it isn't it sets the language back to the default language, or in your case throw a 404.

For the "allowable values", I read them from the site config with a new property there:

<site name="website" ... permissableLanguages="pl-PL,en" language="pl-PL" ... />

That permissableLanguages property is handy as we can also use it later on in the site when presenting a language selection control to the user.

0
votes

You may want to take a look at the Language Fallback module in the Sitecore Shared Source Library. As it covers some of your scenarios.

http://trac.sitecore.net/LanguageFallback