Problem: I have a nested View structure. If the inner View returns no results, I would like to hide the headline produced in the outer View.
Solution: Use a shortcode attribute to pass the current post ID into the nested View. Move the headline into the inner View's wpv-items-found section, and use the "item" attribute to target the parent post based on the shortcode attribute.
[wpv-view name="Future-events-same-band-inner" limit="4" offset="0" bandid="[wpv-post-id]"]
[wpv-layout-start] [wpv-items-found] <h1 class="future-event-same-band-headline">[wpml-string context="wpv-view" name="in event"]Предстоящи събития на [/wpml-string] [wpv-post-title output="sanitize" item="[wpv-attribute name='bandid']"]</h1> <hr> <!-- wpv-loop-start --> <wpv-loop> ...
Relevant Documentation:
https://toolset.com/documentation/user-guides/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 2 replies, has 2 voices.
Last updated by 5 years, 4 months ago.
Assisted by: Christian Cox.