Sitecore: Setting the default culture/landing page for a Page Editor

689 views Asked by At

I have a user that is a Page Editor. I don't want this user going through the Content Editor. He will go directly into Page Editor/Preview Mode.

I want this user to land on the http:///en-ca page.

Even though this users Default Context Language is set to English Canada the user lands on the default US English page, even though he does not have access to that page.

If this user does go through the content editor they get their culture set properly and they can only see en-CAN and fr-CAN, as excepted.

Here is the stranger thing. If the user navigates to http:///en-ca and then logs out and logs back in they go directly back to http:///en-ca, even if we clear cookies and browser cache. So that implies that sitecore keeps a last login page or something. Is that correct?

We are using 7.5

enter image description here

2

There are 2 answers

3
Jonathan Robbins On

So based on a few resources you need to restrict users from accessing languages they shouldn't.

To restrict what languages a user can view, use the Security Editor to deny access to the language items under /System/Languages like you would with any other Sitecore item.

This should prevent the user from accessing that default language site.

In order to take the user to the correct language version of the homepage you will need to create a custom LanguageResolver processor as Sitecore doesn't seem to be doing itself. See this link how to do that - http://www.newguid.net/sitecore/2012/adding-ip-lookup-to-language-resolving/

In your new processor you will want to check Sitecore.Context.PageMode to see if the editor or preview is being used.

Then you want to set Sitecore.Context.Language to the language the User in context has chosen in their Default Content Language field of their Profile.

0
Rabehaja Harivola Loic On

One thing you may try is to set Access control to that user based on the language he has access to.

For instance, you can remove its access to every button except the "Preview mode" on the ribbon and you remove all access to the every language except the "en-ca".

If the user does not have access to the item on a specific language, sitecore redirects the user to login page on the preview mode.

Hope this can help.