Skip Navigation

[Resolved] Filter by taxonomy stopped working with wpml-string shortcode

This thread is resolved. Here is a description of the problem and solution.

Problem: I have a custom search View with a taxonomy filter. I am trying to translate the default_label attribute using the wpml-string shortcode, but it breaks the filter. How can I translate the default_label text?

Solution: The wpml-string shortcode is not necessary here. You should be able to translate the default_label string in String Translation, where it is automatically registered under the domain corresponding to the View's name. See another ticket for more information: https://toolset.com/de/forums/topic/cannot-get-a-string-in-a-view-translated/

This support ticket is created 4 years, 12 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.

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 4 replies, has 2 voices.

Last updated by Eugene Mednikov 4 years, 11 months ago.

Assisted by: Christian Cox.

Author
Posts
#1427303

These are my filters. Somehow taxonomy filters aren't working (e.g. show all results). When I filter by first/last name or free text, it's working fine. I'm not sure whether it happened after the last upgrade, or some options change...

Taxonomy filter
Select posts with taxonomy: Position slug in one of those set by the URL parameter wpv-position
AND Practice slug in one of those set by the URL parameter wpv-practice

Custom field filter
Select items with field: Last Name is a string equal to URL_PARAM(wpv-wpcf-lawyer-last-name)
OR First Name is a string equal to URL_PARAM(wpv-wpcf-lawyer-last-name)

Post search filter
Filter post title, content and fields by a text search that will be added manually using the shortcode [wpv-filter-search-box].

#1430259

Hi, I'll be glad to take a closer look. Please try this first:
- Delete the taxonomy filter control from the View's Search and Pagination panel.
- Delete the taxonomy Query Filter.
- Recreate the taxonomy filter control in the Search and Pagination panel.
- Test again. If this does not resolve the problem, I'll need to take a closer look. Please provide login credentials here and let me know where I can see the View on your site.

#1431633

this fails:
[wpv-control-post-taxonomy taxonomy="practice" type="select" default_label="[wpml-string context='herzoglaw']PRACTICE[/wpml-string]" url_param="wpv-practice"]

this works:
[wpv-control-post-taxonomy taxonomy="practice" type="select" default_label="PRACTICE" url_param="wpv-practice"]

why default label translation breaks the filter?

#1431691

Okay I see, you should not need to use the wpml-string shortcode here. The default text label should be automatically registered in String Translation. Try searching in String Translation for PRACTICE under the text domain corresponding to this View. See more information about this in another ticket:
https://toolset.com/de/forums/topic/cannot-get-a-string-in-a-view-translated/

Let me know if you are unable to translate the default label like this in String Translation and I will take a closer look.

#1431807

My issue is resolved now. Thank you!