Problem: I would like to use the same View in multiple places on the same page, but I want to avoid unique IDs.
Solution: Use wpv-attribute to help generate that unique ID. For example, let's say you use the same View in two places on the same page. Add the placement attribute, and set some unique value for each View:
[wpv-view name="Your View Name" placement="abc"] [wpv-view name="Your View Name" placement="def"]
Then inside the loop, you can access the placement attribute to make the IDs unique.
<div class="collapse" id="collapse-[wpv-attribute name='placement']-[wpv-post-id]">
Results:
<div class="collapse" id="collapse-abc-123"> ... <div class="collapse" id="collapse-def-123">
Relevant Documentation:
https://toolset.com/documentation/user-guides/passing-arguments-to-views
https://toolset.com/documentation/user-guides/views-shortcodes/#vf-309292
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 6 years, 2 months ago.
Assisted by: Christian Cox.