Skip Navigation

[Gelöst] Pass a variable to a view

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

Problem:

Use third party shortcode insider Views shortcode [wpv-view].

Solution:

The shortcode within shortcode is a feature of Views plugin, you can register your own custom shortcode here:

Go to Toolset->Settings and click on the Front-end Content tab. Look for the section called Third-party shortcode arguments

Relevant Documentation:

https://toolset.com/documentation/user-guides/shortcodes-within-shortcodes/

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

Heute stehen keine Supporter zur Arbeit im Werkzeugsatz-Forum zur Verfügung. Sie können gern Tickets erstellen, die wir bearbeiten werden, sobald wir online sind. Vielen Dank für Ihr Verständnis.

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: Asia/Hong_Kong (GMT+08:00)

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

Zuletzt aktualisiert von Kostas vor 6 Jahren, 2 Monaten.

Assistiert von: Luo Yang.

Author
Artikel
#1098440

Hi,

I am currently using a view successfully into a page, like this:

[wpv-view name="grandparent-view-taster-users" cached="on" groupyear="[wpv-user field='wpcf-taster-group']"]

Now, on another page, I need to use same view but groupyear to come from a shortcode I have built, like this:

[taster_group_year_select_form]
[wpv-view name="grandparent-view-taster-users" cached="on" groupyear="???"]

How should I pass the variable $tasteryear coming from the shortcode, into groupyear of the view?

Thanks in advance,
Kostas

#1098467

Dear Kostas,

The shortcode within shortcode is a feature of Views plugin, you can register your own custom shortcode here:
Go to Toolset->Settings and click on the Front-end Content tab. Look for the section called Third-party shortcode arguments

See our document:
https://toolset.com/documentation/user-guides/shortcodes-within-shortcodes/

#1098756

That did the trick, thank you Luo!
For those wondering, I registered my custom code as instructed and then used:

[wpv-view name="grandparent-view-taster-users" cached="on" groupyear="[taster_group_year_select_form]"]

Best regards,
Kostas