Skip Navigation

[Resolved] Dieplay certain files in certain language

This support ticket is created 5 years, 5 months ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Our next available supporter will start replying to tickets in about 6.52 hours from now. Thank you for your understanding.

Sun Mon Tue Wed Thu Fri Sat
8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 - -
13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 - -

Supporter timezone: America/New_York (GMT-04:00)

This topic contains 1 reply, has 2 voices.

Last updated by Christian Cox 5 years, 5 months ago.

Assisted by: Christian Cox.

Author
Posts
#1280469

Hello
I have created custom fields in produkt page, where we can add file url. They are displayed as button and will open in new window – that is all working.
There are 7 files per languagae and my customer would like to insert them all (all languages files )in main language. So rather to translate them – they would like to insert them at once.
But that means that if there is 4 languages, in admin area will be inserted 28 files...
So is there possibility to display for example only english files in english page, russian files in russian page etc. How to do that?
And other question
Is there a way ( tutorial ) to display files Button as dropdown menu?

#1280475

If you want to manage all the fields in the primary language without translation, you can use WPML String Translation and the wpml-string shortcode. For example, in the Content Template for your custom post type, insert the 4 primary language fields in a wpml-string shortcode:

[wpml-string context="your-theme-context"]Language 1 field 1: [types field='lang-1-field-slug-1'][/types][/wpml-string]
[wpml-string context="your-theme-context"]Language 1 field 2: [types field='lang-1-field-slug-2'][/types][/wpml-string]
[wpml-string context="your-theme-context"]Language 1 field 3: [types field='lang-1-field-slug-3'][/types][/wpml-string]
[wpml-string context="your-theme-context"]Language 1 field 4: [types field='lang-1-field-slug-4'][/types][/wpml-string]
...

Then in WPML String Translation, you can edit this string into different languages:

Language 2 field 1: [types field='lang-2-field-slug-1'][/types]
Language 2 field 2: [types field='lang-2-field-slug-2'][/types]
Language 2 field 3: [types field='lang-2-field-slug-3'][/types]
Language 2 field 4: [types field='lang-2-field-slug-4'][/types]
...
Language 3 field 1: [types field='lang-3-field-slug-1'][/types]
Language 3 field 2: [types field='lang-3-field-slug-2'][/types]
Language 3 field 3: [types field='lang-3-field-slug-3'][/types]
Language 3 field 4: [types field='lang-3-field-slug-4'][/types]
...
Language 4 field 1: [types field='lang-4-field-slug-1'][/types]
Language 4 field 2: [types field='lang-4-field-slug-2'][/types]
Language 4 field 3: [types field='lang-4-field-slug-3'][/types]
Language 4 field 4: [types field='lang-4-field-slug-4'][/types]
...

... and so on.

Is there a way ( tutorial ) to display files Button as dropdown menu?
This would require your own custom HTML, CSS and JavaScript code. The Bootstrap library offers a dropdown menu you can use: https://getbootstrap.com/docs/3.3/components/#btn-dropdowns
You can enable Bootstrap in Toolset > Settings > General. Then you would have to use custom JavaScript to respond to the select event.