Jump to content

Get values of options fieldtype


nabo
 Share

Recommended Posts

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

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;

 

  • 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...