Navigation überspringen

[Gelöst] Views shortcode and passing multi argument

Dieser Thread wurde gelöst. Hier ist eine Beschreibung des Problems und der Lösung.

Problem:
Views shortcode and passing multi argument

Solution:
You can pass multiple values to view's shortcode attribute using comma separated values.

For example:

[wpv-views name"displesson" lessontype=" Adults,Kids"], 

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

This support ticket is created vor 6 Jahren, 4 Monaten. 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)

Dieses Thema enthält 3 Antworten, hat 2 Stimmen.

Zuletzt aktualisiert von Pat vor 6 Jahren, 4 Monaten.

Assistiert von: Minesh.

Author
Artikel
#1114354

Pat

Hello,

I have created a Views (displesson) that display lessons and have added a filter to be able to define which kind of lessons to display.
I have 3 types of lessons :
-Adults
-Kids
-Special

Now, if I'm using it as standard way (ie [wpv-views name"displesson" lessontype="Adults"], everything works fine.
But if I need to display only 2 types in the same time (ie Adults + Kids), then, I have not found how to place it in the shortcode.

Can you help please?
Regards
Pat

#1114832

Minesh
Supporter

Sprachen: Englisch (English )

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

Hello. Thank you for contacting the Toolset support.

Well - what if you try to add it comma separated as:

[wpv-views name"displesson" lessontype=" Adults,Kids"], 

And with your view change the query filter to "IN" clause.

#1114838

Pat

Hi Minesh,

Thanks for your info.
Unfortunately, this is not working (nothing displayed).
I dont know if this is linked to this, but my lessontypes are made by 2 words : Cours adulte, Cours enfant and Cours libres
Do you think that having 2 words could make this is not working properly?
Regards
Pat

#1114881

Pat

Oooppppsss !

I had forgotten to put the query filter to IN
Now it's done and this is working fine.
Many thanks
Pat