Try our conversational search powered by Generative AI!

Hide language versions in the page tree

Vote:
 

Hi!

I'm working on a site with multiple languages. Some languages also have a different page-structure than others.

In order to not confuse editors too much, I would like to hide pages in the page tree that are in languages that the edior does not have rights to edit.

By default EPiServer display those pages grayed out, with a padlock. I don't want the editor to see them at all.

Example: A Swedish editor should see Swedish pages and the English pages, but the other languages should not be visible at all.

Is this possible?

Regards

Gustav

#139510
Oct 05, 2015 15:28
Vote:
 

Hi,

But if you hide the page in the tree, then how you will translate the page?

#139511
Oct 05, 2015 15:31
Vote:
 

My thought was that I will show pages in the language that the editor has access to (e.g. swedish), as well as the master language (en).

Regards

Gustav

#139512
Oct 05, 2015 15:35
Vote:
 

You could try to prepare a custom implementation of GetChildrenQuery class.

The GetContent method contains parameter of ContentQueryParameters type. And there is a informationsiotn about preffered culture.

Inside the method you need to filter the content based on ContentLanguage.PreferredCulture.

[ServiceConfiguration(typeof(IContentQuery))]
public class CustomGetChildrenQuery : GetChildrenQuery
{
    public CustomGetChildrenQuery(IContentQueryHelper queryHelper, IContentRepository contentRepository, LanguageSelectorFactory languageSelectorFactory) : base(queryHelper, contentRepository, languageSelectorFactory)
    {
    }

	public override int Rank
	{
	  get
	  {
		return 100;
	  }
	}

    protected override IEnumerable<IContent> GetContent(ContentQueryParameters parameters)
    {
		var result = base.GetContent(parameters);

		//ContentQueryParameters contains PreferredCulture
		// here you should apply filters
		// based on ContentLanguage.PreferredCulture (which is a current culture)
        return result;
    }
}



#139518
Oct 05, 2015 17:18
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.