Jump to content

multi languages on processwire 3.x/2.8x


adrianmak
 Share

Recommended Posts

While I kept reading each update blog post weekly, I remembered that there is some improvement of multi languages of pw3.

However I forgot the content exactly.

Is a multi language field can be disable on certain template ?

Let say, a title field type is  textmulti, in the past, every template using this field must a multi language field

In pw3, I could use as a non-multilanguage text field for a template.

isn't it ?

 

 

 

Link to comment
Share on other sites

Thanks for that @tpr - I hadn't really noticed that option since I started doing multi-language sites just recently. The nice thing about that is that you can set that 

$page->template->noLang = 1;

at runtime which means you can add some logic in your site ready.php file to determine which pages have multi-language fields enabled/disabled. 

Here is a quick idea that disables all multi-language fields on the branch that with the parent of ID: 1111

$p = $pages->get((int)$input->get->id);
if($p->parents("id=1111")->count()>0 || $p->id === 1111) {
    $p->template->noLang = 1;
}

Now what I would actually like to do is control which languages are available in on a per branch basis - so I have this request in: https://github.com/processwire/processwire-requests/issues/54

and also here are my initial ideas around this:

 

  • Like 1
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...