Translate sorting widget with WPML
-
I’m trying to translate the sorting widget with WPML, but the title field is not showing up in the WPML translation editor. Is it possible to translate this widget?
Thank you
The page I need help with: [log in to see the link]
-
Hi @madebypaletta,
Thanks for the message.
At the moment, the Sorting Widget lets you freely enter custom text for each sorting option in the widget settings. These labels are not pre-defined strings, they’re manually entered by the user and saved in the widget instance.
Because of that, WPML won’t automatically recognize them for translation in the Translation Editor. If you need the labels to appear in multiple languages, you’ll need to edit the widget content on each translated page in Elementor and input the translated version of each label directly.
I’ll look into adding broader translation support for these free text labels in a future update, but for now, they’re not automatically translatable, as each widget instance can be accessed on the translated page and edited manually.
Let me know if you have any other questions or need assistance with anything else.
Regards,
DaraThank you for your reply. I hope this can be implemented!
I’d like to know if it’s possible in a filter widget (label list) to disable the selected filter when I select a different one. I’ve selected the “OR” modifier in the filter settings but it’s not working properly. It allows me to select both filters.
Best
Andrea
Hi Andrea,
The label list field type are checkboxes in disguise, so it’s designed to allow multiple selections, even when using the “OR” modifier. The OR/AND will however influence the results, when more than one of those labels are selected.
If you’d like to only allow one filter at a time (like radio buttons), you could add a small JavaScript snippet to force that behavior by deselecting the previous choice when a new one is clicked.
That said, I think it’s a good idea, and I’ll consider adding a built-in option to switch between single/multi choice for the label list. At the moment, you could still get similar results by selecting the radio field type, and use the option to hide the input and display the labels horizontally.
Let me know if you’d like help with those options.
Best,
DaraHi Dara, I’ve tried using the radio field type, but unfortunately I can’t target the selected state. I think it would be better to stick with the label and JavaScript. Could you help me with this?
Best,
AndreaHi Andrea,
Here’s a simple script you can use. It ensures that only one checkbox from the label list can be selected at a time, but only for items inside list elements with the .list-style class:
<script>
document.addEventListener(‘DOMContentLoaded’, function () {
const listItems = document.querySelectorAll(‘li.list-style’);const checkboxes = Array.from(listItems)
.map(li => li.querySelector(‘input.bpfwe-filter-item’))
.filter(input => input); // Skip if no input found.checkboxes.forEach(checkbox => {
checkbox.addEventListener(‘change’, function () {
if (this.checked) {
checkboxes.forEach(cb => {
if (cb !== this) cb.checked = false;
});
}
});
});
});
</script>Let me know if you need help with the script placement or further adjustments.
Regards,
DaraIt works like a charm! Thank you for your help and for the plugin!
Best,
AndreaI just wanted to let you know that the WPML team provided a workaround to make the text translatable. Add this code to the custom XML area in the WPML settings, then re-translate the page on which you added the widget.
<wpml-config>
<elementor-widgets>
<widget name="post-widget">
<fields>
<field>extra_skin_list</field>
<field>skin_custom_html</field>
<field>post_list</field>
<field>user_list</field>
<field>taxonomy_list</field>
<field>nothing_found_message</field>
<field>post_external_url</field>
</fields>
<fields-in-item items_of="post_list">
<field>display_date_format</field>
<field>on_sale_text</field>
<field>new_arrival_text</field>
<field>best_seller_text</field>
<field>post_read_more_text</field>
<field>product_buy_now_text</field>
<field>pin_text</field>
<field>unpin_text</field>
<field>republish_option_text</field>
<field>unpublish_option_text</field>
<field>edit_option_text</field>
<field>delete_option_text</field>
<field>field_before</field>
<field>field_after</field>
</fields-in-item>
<fields-in-item items_of="user_list">
<field>visit_profile_text</field>
</fields-in-item>
<fields-in-item items_of="taxonomy_list">
<field>term_read_more_text</field>
</fields-in-item>
</widget>
<widget name="search-bar-widget">
<fields>
<field>search_placeholder_text</field>
<field>display_submit</field>
<field>search_button_text</field>
<field>redirect_submission</field>
<field>redirect_url>url</field>
</fields>
</widget>
<widget name="sorting-widget">
<fields>
<field>order_by_list</field>
</fields>
<fields-in-item items_of="order_by_list">
<field>sort_title</field>
<field>_id</field>
</fields-in-item>
</widget>
<widget name="filter-widget">
<fields>
<field>filter_list</field>
<field>default_filters</field>
<field>reset_text</field>
<field>submit_text</field>
<field>nothing_found_message</field>
</fields>
<fields-in-item items_of="filter_list">
<field>filter_title</field>
<field>option_text_cf</field>
<field>option_text</field>
<field>text_input_placeholder</field>
<field>select_all_label</field>
</fields-in-item>
</widget>
</elementor-widgets>
</wpml-config>
The topic ‘Translate sorting widget with WPML’ is closed to new replies.