Problem: I would like to pass values from one View into another View nested inside the original View.
Solution: You can place a View in a custom HTML block and include various shortcode attributes:
[wpv-view name="slug-of-nested-view" attr1="[wpv-post-id]" attr2="[types field='some-slug'][/types]"]
That would display the nested View and pass the current post ID from View 1 into an attribute attr1, and it would pass the value of custom field some-slug from the current post of View 1 into an attribute attr2.
Then in View #2, you can set various Query Filters to respond to these shortcode attributes, or you can use the wpv-attribute shortcode to access those attributes in the Loop editor:
Parent post ID: [wpv-attribute name="attr1"]<br /> Parent post custom field "some-slug": [wpv-attribute name="attr2"]
Relevant Documentation:
https://toolset.com/documentation/programmer-reference/views/views-shortcodes/#wpv-view
https://toolset.com/documentation/programmer-reference/views/views-shortcodes/#wpv-attribute
https://toolset.com/course-lesson/passing-arguments-to-views/
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 |
---|---|---|---|---|---|---|
8:00 – 12:00 | 8:00 – 12:00 | 8:00 – 12:00 | 8:00 – 12:00 | 8:00 – 12:00 | - | - |
13:00 – 17:00 | 13:00 – 17:00 | 13:00 – 17:00 | 13:00 – 17:00 | 13:00 – 17:00 | - | - |
Supporter timezone: America/New_York (GMT-04:00)
This topic contains 3 replies, has 2 voices.
Last updated by 3 years, 4 months ago.
Assisted by: Christian Cox.