Bike Posted March 25, 2021 Share Posted March 25, 2021 Hello everyone, I have a select field say "publishers" and I need its content to be different for every language. In the US there are different publishers than in GB. How to set up this kind of field? Couldn't find anything about it. Would be nice if someone could help ... Link to comment Share on other sites More sharing options...
3fingers Posted March 25, 2021 Share Posted March 25, 2021 Hi Bike, are you referring as a select inside a template in the back-end or an html select rendered on the front-end? Link to comment Share on other sites More sharing options...
Bike Posted March 29, 2021 Author Share Posted March 29, 2021 Hi @3fingers, it's supposed to be in the back-end. Link to comment Share on other sites More sharing options...
3fingers Posted March 30, 2021 Share Posted March 30, 2021 There are different ways to accomplish this, as usual. The first coming to my mind right now is to use: Basically you should have two page reference fields, one for each group of editors (eg. us_editors, gb_editors, etc.). Those page reference should point to the corresponding branch inside the page tree: - Us Editors // page reference -> us_editors -- editor #1 -- editor #2 -- ... - Gb Editors // page reference -> gb_editors -- editor #1 -- editor #2 -- ... Then you might want to use a custom selector (custom selector option of the module linked above) based on your language to show only the correct page reference field. Eg: $user->language->id = 1234 // The id of the language the page field might be shown //OR $user->language->name = 'GB' // Or whatever the name you have choosen Then in your template file you can work with the editors whom belong to the current user language $editors = ($user->language->name == 'US') ? $page->us_editors : $page->gb_editors; This method will fail shortly if you plan to have more than two languages. Another, and probably more reliable, method is to use a hook on page creation and populate a single page reference with the values you need. Link to comment Share on other sites More sharing options...
Bike Posted April 7, 2021 Author Share Posted April 7, 2021 Thanks @3fingers I think this is something different from what I actually need. In fact I am looking for a select field with language tabs like any other multi-language field (textfield, textarea) in the backend. Link to comment Share on other sites More sharing options...
3fingers Posted April 7, 2021 Share Posted April 7, 2021 Currently I don't think it's possibile with just one select field because options for language A must match options for language B (and so on...). As far as I know you then need to select field (or page field) for what you are looking for. Link to comment Share on other sites More sharing options...
Bike Posted June 25, 2021 Author Share Posted June 25, 2021 Hi everbody, I still didn't find any solution for this problem though I think it might be something not too fancy. Looking for a select field (ASM too!) with language tabs. For each language there is not only a translation but an entirely different content. Ex: Select field "Publishers". Field holds different lists of publishers for each language EN / DE / ES. Or: ASM Select "Available as". Holds options such as "book", "ebook", "audiobook". Different selection possible for each language. In case I am not making it clear enough have a look at the pictures ? Link to comment Share on other sites More sharing options...
Bike Posted July 5, 2021 Author Share Posted July 5, 2021 Nobody? ? Link to comment Share on other sites More sharing options...
horst Posted July 5, 2021 Share Posted July 5, 2021 I think it can be done with language alternate fields. 1 Link to comment Share on other sites More sharing options...
Bike Posted September 6, 2021 Author Share Posted September 6, 2021 Sorry for bothering again but I still could not find any solution to this ? A clue anyone? Link to comment Share on other sites More sharing options...
horst Posted September 6, 2021 Share Posted September 6, 2021 51 minutes ago, Bike said: Sorry for bothering again but I still could not find any solution to this ? A clue anyone? I posted you a link 2 month ago: I think it can be done with language alternate fields. Have you checked it? 2 Link to comment Share on other sites More sharing options...
Bike Posted September 17, 2021 Author Share Posted September 17, 2021 Hi @horst, I did check it but don't know how to achieve select fields with different content for each language. I think it actually must be something easy and common to do. 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