Hi There,
I am using PloyLang to help translate my build with Bricks Builder.
It would be nice to use the new Element Conditions to do “if language equals X”.
But I don’t know how to do this.
Thanks
Hi There,
I am using PloyLang to help translate my build with Bricks Builder.
It would be nice to use the new Element Conditions to do “if language equals X”.
But I don’t know how to do this.
Thanks
Hello
We need to use the php function get_locale for this. I know how to set the condition on Oxygen, but not on Bricks yet. If I find a solution for this in my post, I am sure it will solve your question too.
I found the solution. You need to use {echo:get_locale} on the field and then the slug of the language you want. Like this:
Awesome!
I actually found the solution by looking at how Oxygen Builder did their conditions!
But thank you!!
Hi,
I use this for Polylang:
I use an intermediary function instead of directly calling pll_current_language()
so that I can deactivate Polylang plugin without causing PHP error.
(Maybe there’s a better way to do that )
function plang() {
if ( function_exists('pll_current_language') )
return pll_current_language('slug');
else
return 'fr';
}
@UbuntuProductions method worked for me, but I also contacted Bricks Support and they told me the official way:
You can set which custom post types should support multilanguage.
Go to Languages > Settings > Custom Post Types and Taxonomies, you should tick “My Templates”
After that, you should be able to see an additional column by Polylang.
Just click “plus” button to add the new language template.