Skip Navigation

[Resolved] More than one loop in a single View

This thread is resolved. Here is a description of the problem and solution.

Problem: I would like to use two loops in the same View. I would like to use the first loop to create tab buttons, and the second loop to create tab panels.

Solution: It's not currently possible to use multiple loops in the same View, so you must create two Views.

Relevant Documentation: https://toolset.com/documentation/user-guides/digging-into-view-outputs/

This support ticket is created 6 years, 5 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
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 4 replies, has 2 voices.

Last updated by teganK 6 years, 5 months ago.

Assisted by: Christian Cox.

Author
Posts
#951185

i want to set the <wpv-loop> to do some thing as follows

<div class="tab"> ----------> run 1 time

<button class="tablinks" onclick="openTab(event, '[types field="design-name"][/types]')">[types field="design-name"][/types]</button> ----------> loop
</div> ----------> run 1 time
--------------loop below -------------------------
<div id="[types field='design-name'][/types]" class="tabcontent" >

<h3>[types field="design-name"][/types]</h3>
[types field="design-price"][/types]
[types field="design-bedroom"][/types]
[types field="design-bathroom"][/types]
[types field="design-garage"][/types]
</div>

------------------loop end-------------------

can you please guide how to achieve this ?

The following is the page link
hidden link

#951238

<div class="tab">
<wpv-loop>
<button class="tablinks" onclick="openTab(event, '[types field="design-name"][/types]')">[types field="design-name"][/types]</button>
</ wpv-loop >
</div>
- <wpv-loop>
<div id="[types field='design-name'][/types]" class="tabcontent" >

<h3>[types field="design-name"][/types]</h3>
[types field="design-price"][/types]
[types field="design-bedroom"][/types]
[types field="design-bathroom"][/types]
[types field="design-garage"][/types]
</div>
</ wpv-loop >
here is what i actually need

#951239

<div class="tab">
<wpv-loop>
<button class="tablinks" onclick="openTab(event, '[types field="design-name"][/types]')">[types field="design-name"][/types]</button>
</ wpv-loop >
</div>
- <wpv-loop>
<div id="[types field='design-name'][/types]" class="tabcontent" >

<h3>[types field="design-name"][/types]</h3>
[types field="design-price"][/types]
[types field="design-bedroom"][/types]
[types field="design-bathroom"][/types]
[types field="design-garage"][/types]
</div>
</ wpv-loop >
here is what i actually need

#951550
Screen Shot 2018-07-19 at 3.28.56 PM.png

It's not currently possible to use multiple wpv-loop tags in the same View, so I think you would have to create two different Views to achieve this. Set up one View to hold the tab buttons. Be sure the loop is returning the correct results, then duplicate the View by going to Toolset > Views and hovering over the View name. Modify the Loop Editor in the duplicate View to include the tab content.

#952037

Thanks