Skip Navigation

[Resolved] Filter by ids in view doesn’t work

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

Problem:
How to pass view's shortcode argument

Solution:
We have detailed doc available about it. You can find more details under section "Controlling the filter with shortcode attributes".

Relevant Documentation:
https://toolset.com/documentation/user-guides/passing-arguments-to-views/

This support ticket is created 7 years 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 kirillS-3 7 years ago.

Assisted by: Minesh.

Author
Posts
#592932
Screenshot 2017-11-24 16.15.11.png

I am trying to:

Filter view output by post IDs, doing this:

<div>[wpv-view name="professioninprofiguideview" $ids="[types field='profiguide-profession-ids' format='FIELD_VALUE' separator=','][/types]"]</div>

So, 'profiguide-profession-ids' is numeric field with multiple possible values, contain only few IDs like
35872
35991
etc...

Link to a page where the issue can be seen:

Hm... this is hidden now from public

I expected to see:

View, filtered by ID's (see screenshot)

Instead, I got:

All posts of this type, not just listed in $ids param

#593245

Minesh
Supporter

Languages: English (English )

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

Hello. Thank you for contacting the Toolset support.

Well - I see how you added the view's shortcode attribute and by reviewing that code I found that you have added the view's shortcode attribute wrong way.

Could you please try to add view's shortcode attribute as given under - You should not use "$" sign with attribute name:

[wpv-view name="professioninprofiguideview" ids="[types field='profiguide-profession-ids' format='FIELD_VALUE' separator=','][/types]"]

More info:
=> https://toolset.com/documentation/user-guides/passing-arguments-to-views/
[Section: "Controlling the filter with shortcode attributes"]

#593386

Oh, really simple. I actually use it right in other views...
Thanks for help!