nabo Posted November 8, 2018 Share Posted November 8, 2018 Hello I can't get the title in other language than default $type_materials = $fields->get('material_tipology'); foreach ($type_materials->type->getOptions($type_materials) as $type_material) { echo $type_material->title; } this works but I get only default title in every language. Link to comment Share on other sites More sharing options...
BitPoet Posted November 8, 2018 Share Posted November 8, 2018 There's (I think) no direct method to access language specific properties yet, but you can do this: <?php $lang = $languages->get('name-of-your-language'); $langTitle = $type_material->get('title' . $lang->id); Or, if you know the language id (e.g. 1060), you could do: <?php $langTitle = $type_material->title1060; 1 Link to comment Share on other sites More sharing options...
kixe Posted November 8, 2018 Share Posted November 8, 2018 To get the options title in current user language use $type_material->getTitle(); or enable outputformatting $type_material->of(true); $type_material->get('title'); 4 Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now