Skip Navigation

[Resolved] Adding filters to a view

This support ticket is created 4 years, 3 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
9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 - - 9:00 – 13:00
14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 - - 14:00 – 18:00

Supporter timezone: Africa/Casablanca (GMT+01:00)

This topic contains 2 replies, has 2 voices.

Last updated by johnG-18 4 years, 2 months ago.

Assisted by: Jamal.

Author
Posts
#1924671

Tell us what you are trying to do?
I have a type called wine. This type has the taxonomy style. I want to filter by style. I'm created a view, but I can only sort and paginate. I want to be able to filter by wine style. Is this possible?

Is there any documentation that you are following?
This pages describes adding a filter to a view. https://toolset.com/documentation/user-guides/views/passing-arguments-to-views/. I can't find these features.

Is there a similar example that we can see?
hidden link

What is the link to your site?
my site is winosity.com.
I'm using blocks 1.3.5 and types 3.4.5.

#1925247

Hello and thank you for contacting the Toolset support.

I am not really sure to understand what do you mean. Would you want to have a dropdown or radio buttons to filter with the styles? Or would you like the view to display wines only from selected styles? Can you elaborate more on it so I can understand it better?

In the meantime, I checked the view of the hidden link page, and it seems to be built using the Blocks Editor(Gutenberg), you can find the same filters for the features below, from the documentation article, in the content selection section of the view. Check this screenshot hidden link
- Filters by custom fields
- Filters by taxonomies
- Filter by authors
- Filter by post relationships

The example about Controlling the filter with URL arguments is also possible through the same filters. The wpv-search-term shortcode will also work as expected. https://toolset.com/documentation/programmer-reference/views/views-shortcodes/#wpv-search-term

But, Controlling the filter with shortcode attributes is not yet available for block-based views. It is only available for views that are created in the legacy editor using shortcodes:
https://toolset.com/documentation/programmer-reference/views/views-shortcodes/
You can enable the legacy editor in Toolset->Settings->General(tab)->Editing Experience.

You can also filter the view using custom code, if you are comfortable with PHP programming, by hooking into the wpv_filter_query and modifying the underlying WP_Query instance:
- https://toolset.com/documentation/programmer-reference/views-filters/#wpv_filter_query
- https://developer.wordpress.org/reference/classes/wp_query/

#1928587

My issue is resolved now. Thank you!