Jump to content

Hide Content on Language


Recommended Posts


I am fairly new to Processwire. In the past I used OctoberCMS for my project. But I have more and more multilanguage projects and OctoberCMS don't fit my needs anymore.

My first question to the community is, is it possible to hide/disable content based on the language. I mean, can a content editor say in German I want this content block and in Englisch I wanna hide this content block, based on the same layout?

Thanks for your answers.

Link to comment
Share on other sites

Welcome to the forum, @MateThemes !

As @Gideon So already pointed out, to accomplish this you will need to implement a condition on your template code depending on your business needs, but it can also be achieved without any custom code if it's just a matter of hiding a portion of a content from a page that has both languages.  

If you could explain a little bit more about what you want to accomplish, we can help. ?


Link to comment
Share on other sites

Languages are Pages in PW (like almost everything else). A user viewing any page in multilanguage environment has a language property attached (see here). So you can do it like this:


if($user->language->name != 'default') {
	echo 'Hello, multilanguage world!';

You can use $user->language->id if you want.

  • Like 3
Link to comment
Share on other sites

You have several options in the backend:

1.) Page based under Page > Settings
Enable or disable every non default language. Trying to access an inactive page will result in an 404



2.) Template based under Template > Advanced (bottom)



3.) Field based under Edit Field > Details



  • Like 2
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Create New...