Skip Navigation

[Gelöst] Use of custom function as a views shortcode attribute

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

Problem:
The issue here is that the user wanted to add a custom shortcode as an attribute to his views shortcode parameter like this.

[wpv-view name="liste-der-vorstandsfunktionen-im-aktuellen-clubjahr-neu" wpvccy="[currentclubyear]"]

Solution:
This is possible, however since it is a custom shortcode you will need to add it to the views third party shortcode arguments.
To do this you will need to go to Toolset -> Settings -> Frontend Content and then add your shortcode name to the Views 3rd party shortcode arguments.

Once you have done this then it shoulda start working,

This support ticket is created vor 7 Jahren. 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 – 12:00 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 -
- 13:00 – 18:00 13:00 – 18:00 13:00 – 18:00 14:00 – 18:00 13:00 – 18:00 -

Supporter timezone: America/Jamaica (GMT-05:00)

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

Zuletzt aktualisiert von Matthias Reichl vor 7 Jahren.

Assistiert von: Shane.

Author
Artikel
#594386
taxonomy filter.png

I am trying to:

Use a custom function within a views shortcode attribute
I use a taxonomy filter als per attached screenshot
I followed the recommendations in: https://toolset.com/forums/topic/controlling-the-filter-with-shortcode-attributes-current-url/

I call the view within the page with the following code:

Value of function currentclubyear = [currentclubyear]

USE OF FUNCTION IN SHORTCODE

[wpv-view name="liste-der-vorstandsfunktionen-im-aktuellen-clubjahr-neu" wpvccy="[currentclubyear]"]

USE OF VALUE IN SHORTCODE

[wpv-view name="liste-der-vorstandsfunktionen-im-aktuellen-clubjahr-neu" wpvccy="2017/18"]

Link to a page where the issue can be seen:
versteckter Link

I expected to see:
The views output

Instead, I got:
„]

#594487

Shane
Supporter

Sprachen: Englisch (English )

Zeitzone: America/Jamaica (GMT-05:00)

Hi Rainer,

Thank you for contacting our support forum.

Yes this is possible but first you must enable views to process the shortcode. To do this you will need to go to Toolset -> Settings -> Frontend Content and then add your shortcode name to the Views 3rd party shortcode arguments.

Once you have done this then it shoulda start working,

Thanks,
Shane

#594782

Hi Shane!

How could I forget this 😉

Thanks for the hint, it's solved.