Skip Navigation

[Resolved] Use custom shortcode attributes to display in view

This support ticket is created 7 years, 4 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
- 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)

This topic contains 2 replies, has 2 voices.

Last updated by Justin 7 years, 4 months ago.

Assisted by: Luo Yang.

Author
Posts
#540376

I am trying to:
Use custom shortcode attributes to display in view

I am trying to use a GLOBAL Map, but have custom shortcode attributes and use it something like this. I do NOT want to filter my map results, I just want to CENTER it on something using the LAT/LONG,

my shortcode could look something like this
[wpv-view name="map" lat="-113....." long="55......"]

And then inside the actual VIEW how would I place those custom view params into the content template.
[wpv-map-render map_id="map-1" general_center_lat="LAT" general_center_lon="LONG"]

Something like using the VIEW_PARAM() ???? but not sure.

Thanks in advance.

#540400

Dear Justin,

Yes, you can pass parameter with attribute of Views shortcode [wpv-view], see our document:
https://toolset.com/documentation/user-guides/passing-arguments-to-views/
section "Controlling the filter with shortcode attributes",

Then you will be able to get the attribute values with shortcode [wpv-attribute], see above document:
section "Accessing the arguments": If you used a View shortcode attribute to pass the value you can use another shortcode wpv-attribute.

#540656

Awesome thank you!
I didn't see that in the docs.