xxxlogiatxxx Posted October 7, 2019 Share Posted October 7, 2019 Is there any ideas how to find pages by it's translated value of Select Options field title? For example i want to get pages in current language by some option title: Default: 1=Precious 2=Semi-precious Italian: 1=Preziosa 2=Semipreziosa No idea why italian version returned me empty results. $type = $sanitizer->text($input->get->type); $input->whitelist('type', $type); if($type) { $results = $pages->find("template=encyclopedia-item, encyclopedia_item_type.title={$type}, limit=5, sort=title"); } else { $results = $pages->find("template=encyclopedia-item, limit=5, sort=title"); } foreach($results as $result) { echo $result->title; } $data contain value Precious/Preziosa Link to comment Share on other sites More sharing options...
xxxlogiatxxx Posted October 7, 2019 Author Share Posted October 7, 2019 That was my mistake i have to use default values. Thanks everyone ? Link to comment Share on other sites More sharing options...
horst Posted October 7, 2019 Share Posted October 7, 2019 Not 100% sure, as I do not work with options fields, but if you want to search for title values other the default language, you need to add the ID of that language to the fieldname. As example, if your italian language would have the ID 1020, you would have to query for: encyclopedia_item_type.title1020={$type} see: 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