Jump to content

Recommended Posts

Posted

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 ?

 

 

 

Posted

The ML version is a different Inputfieldtype - I don't see any changes in 3.x/2.8 that make it possible to override that on a per template basis. ML is not my forte, so I am sure someone will correct me if I am wrong.

Posted

You can disable multi language for the entire template, not per field (on the Advanced tab as I remember).

  • Like 3
Posted

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

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
  • Recently Browsing   0 members

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