Try our conversational search powered by Generative AI!

Disabling Content By Language

Vote:
 

Hi,
The company I work for is a global company with 13 different languages. As such, there are times when we need to be able to create pages that are only available in specific languages.

We've figured out, that if there aren't any translated content for a page, we can disable a page for that language by going into Tools --> Language Settings --> Settings for Site Visitors, and changing the fallback languages to blank. This makes the page not available in that language however, if I had a translation previously, I see no way to delete that translation making this method invalid.

Is there any easier way of disabling content by language? This method won't work for us long term, and seems kind of hacky.

Thanks,
Paul

#141683
Nov 18, 2015 18:56
Vote:
 

To expand on this, I'm on the MVC version of Episerver. Version 8.11 to be specific.

#141687
Nov 18, 2015 19:47
Vote:
 

Instead of fallback language, you can use replacement language instead. You can also disable the language completely from admin mode under Config > Manage website languages.

#141706
Nov 19, 2015 0:29
Vote:
 

Johan, could you elaborate on how you can use replacement language to disable pages by country?

#141758
Nov 19, 2015 15:36
Vote:
 

Copy paste from the language settings dialog:

Replacement language replaces one language with another, regardless of whether the page has been published in the first language. Replacement language may be useful when, for example, you have started to translate and publish pages for all (or parts) of your website, but do not want to have mixed content until the site has been entirely translated. 

Lets say you have translated pages into Polish and now you want to disable that language, then you set English as replacement language for Polish. By doing this way, editors can still see the Polish language within edit mode.

#141759
Nov 19, 2015 15:57
Vote:
 

Hi Johan,
Thanks for answering my question. I think there was a small miss-communication here on what I'm looking for. I'm looking for a way to show a 404 error for a specific language, while showing the actual page on other languages.

Basically if I have a page, I want it to appears for English, but if you browse to that page while on the China site, it appears as a 404.

I've figured out how to do this by using, "Settings for Site Visitors" however, this failes if an actual translation has been created. I don't see how the replacement language section could help me with this.

- Paul

#141763
Nov 19, 2015 18:28
Vote:
 

You didn't mention that you wanted to trigger a 404. I would solve this with a rewrite rule, action filter or a method in a base class in your templates.

Have you tried to disable the language in admin mode?

#141767
Nov 19, 2015 18:40
Vote:
 

Sorry if I wasn't clear. :)

Could you explain in further detail how I would disable the language in admin mode? Do you mean in the Language Settings panel in edit mode?

#141769
Nov 19, 2015 19:45
Vote:
 

Thanks. But this is editing the language on a global level? I don't want to get 404's for all pages on the website for this language. I only want the ability to disable a single page, for a single language. The link you sent is for managing the language at the global level correct?

#141771
Nov 19, 2015 19:54
Vote:
 

Then you have to build something custom. A handler, module, action filter or whatever :)

#141772
Nov 19, 2015 19:55
Vote:
 

I should say that the recommendation of fixing this solution using a, "handler, module, action filter or whatever", is very unhelpful. 

 

Just so you know, our team has looked into this issue further, and has actually found that this is actually something you can do without writing anything custom.

This is what you need to do...
When a page exists in English, and does not exist in the language you are trying to disable, while in edit mode, Go to Tools --> Edit Languages --> Settings for Site Visitors, and remove the language that you're trying to get a 404.

This solution is actually the same solution in my original comment, however I found an issue with this because if a translation already existed for the language I was trying to disable, in Episerver you're unable to delete that translation. So this only worked for pages that had no translations.

We did figure a way around this initial issue however. If a page did have a translation previously, but now you want that page to show a 404 while keeping the English or other languages the same, you can just expire that page for that specific language as the expiring fields in Episerver are culture specific. 

-Paul

#141774
Edited, Nov 19, 2015 21:04
Vote:
 

I'm glad you found a solution to your problem. The expire function is fairly new and I didn't know it was culture specific, since access rights and stop publish date is not.

Sorry for throwing out some suggestions, won't happen again. And the edit made your comment a bit more professional.

#141776
Nov 19, 2015 22:23
This topic was created over six months ago and has been resolved. If you have a similar question, please create a new topic and refer to this one.
* 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.