Skip Navigation

[Resolved] View with category as an attribute

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

Problem:
How to filter view with shortcode attribute using taxonomy filter

Solution:
You can filter view by adding taxonomy filter and select filter by shortcode attribute to filter your view using custom shortcode attribute for taxonomy filter.

You can find the proposed solution with the following reply:
=> https://toolset.com/forums/topic/view-with-category-as-an-attribute/#post-616224

Relevant Documentation:
https://toolset.com/documentation/user-guides/passing-arguments-to-views/#controlling-the-filter-with-shortcode-attributes

This support ticket is created 6 years, 9 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
- 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10: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: Asia/Kolkata (GMT+05:30)

This topic contains 2 replies, has 2 voices.

Last updated by katjaL 6 years, 9 months ago.

Assisted by: Minesh.

Author
Posts
#616149

This is very very basic question, sorry, but I can't seem to find the answer.

I have created a view, "basic", it's a modified list of custom posts.
Now I would like to add this view as a shortcode on several pages and add category filter on-fly into shortcode.

I know how to create a view based on category, but we have tens of categories, so it would be unconvenient to create separate view for every category.

This would be the idea:
{!{wpv-view name='view-basic' cat='firstcategory'}!}

But it doesn't work. Probably there's no such attribute as "cat". I tried also category, tax and taxonomy.

Thank you in advance for your precious help!

#616224

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Hello. Thank you for contacting the Toolset support.

Your thinking is absolutely perfect and you can achieve this with view's by filtering your view by adding taxonomy filter and select filter by shortcode attribute.

Please check following Doc:
=> https://toolset.com/documentation/user-guides/passing-arguments-to-views/#controlling-the-filter-with-shortcode-attributes

#616225

Yes, perfect, thank you Minesh!!