Skip Navigation

[Resolved] Can a CPT view accept a condition directly in Beaver Builder, e.g. type of book?

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

Problem: I would like to use shortcode attributes to pass arguments into a View's Query Filter.

Solution: You can configure taxonomy filters and custom field filters to respond to separate shortcode attributes, and add those shortcode attributes to the view shortcode.

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

No supporters are available to work today on Toolset forum. Feel free to create tickets and we will handle it as soon as we are online. 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 2 replies, has 2 voices.

Last updated by andreaW-2 2 years, 8 months ago.

Assisted by: Christian Cox.

Author
Posts
#2141309

I have a CPT called Books. I can add a view to my Beaver Builder page that brings up a list of books based on the topic, e.g., Self Help, if I add that condition (Types of Book) to the view itself. However, that means making many views based on the topic of each page. Is there a way to use a more generic view (e.g., shows all books) that can accept a condition using a BB page's modules or a shortcode or something? So I would only have one view, but it can be used to bring up the appropriate list of books depending on the page topic, rather than making a bunch of very specific views.

#2141311
Screen Shot 2021-08-12 at 1.10.40 PM.png

Hello, yes custom field Query Filters and taxonomy Query Filters in Views can be configured to respond to shortcode attributes. Then to place the filtered View in your BB design, you can use a View shortcode with the attribute defined as desired for filtering. So for example if Type of Book is a taxonomy, and the term slug is "self-help", you can configure a Query Filter for the Type of Book taxonomy term, filtered by a term slug set by a shortcode attribute like "termslug". Then in the BB design, add the View in a simple Text editor widget using a shortcode like this:

[wpv-view name="your-view-slug" termslug="self-help"]

In other pages you would change self-help to match the slug of the topic you wish to display in the View. Custom field filters work similarly, and usually respond to the value or content in a custom field. The specific configuration depends on the field type and the values you define for the custom field.

Here is a screenshot showing two similar Query Filters, one for a taxonomy and another for a custom "radio" field. Each is configured to respond to a shortcode attribute in the View shortcode.

Let me know if you need additional guidance and I can help you set this up and implement the correct shortcode structure.

#2141345

My issue is resolved now. Thank you!

This ticket is now closed. If you're a WPML client and need related help, please open a new support ticket.