Hi,
I think I found a bug in the Loop Wizard, to much code in Bootstrap grid and Table-based grid. See images
Cheers
Peter
[wpv-layout-start]
[wpv-items-found]
<!-- wpv-loop-start -->
<wpv-loop wrap="1" pad="true">
[wpv-item index=1]
<div class="row ">
<div class="col-sm-12">[wpv-post-body view_template="Loop item in Blogs - voor persoonlijke teampag. (views)"]</div>
</div>
[wpv-item index=other]
<div class="col-sm-12">[wpv-post-body view_template="Loop item in Blogs - voor persoonlijke teampag. (views)"]</div>
[wpv-item index=pad]
<div class="col-sm-12"></div>
[wpv-item index=pad-last]
<div class="col-sm-12"></div>
</div> <========================================================
</wpv-loop>
<!-- wpv-loop-end -->
[/wpv-items-found]
[wpv-no-items-found]
<strong>[wpml-string context="wpv-views"]No items found[/wpml-string]</strong>
[/wpv-no-items-found]
[wpv-layout-end]
[wpv-layout-start]
[wpv-items-found]
<!-- wpv-loop-start -->
<table width="100%" class="wpv-loop js-wpv-loop">
<wpv-loop wrap="2" pad="true">
[wpv-item index=1]
<tr>
<td>
[wpv-post-body view_template="Loop item in Blogs - voor persoonlijke teampag. (views)"]
</td>
[wpv-item index=other]
<td>
[wpv-post-body view_template="Loop item in Blogs - voor persoonlijke teampag. (views)"]
</td>
[wpv-item index=2]
<td>
[wpv-post-body view_template="Loop item in Blogs - voor persoonlijke teampag. (views)"]
</td>
</tr>
[wpv-item index=pad]
<td></td>
[wpv-item index=pad-last]
<td></td>
</tr> <==============================================================
</wpv-loop>
</table>
<!-- wpv-loop-end -->
[/wpv-items-found]
[wpv-no-items-found]
<strong>[wpml-string context="wpv-views"]No items found[/wpml-string]</strong>
[/wpv-no-items-found]
[wpv-layout-end]
I don't see anything that will produce invalid markup here. Take a look at this screenshot. In the first loop example, your loop is set up with wrap="1". That means there will only ever be one item per row, so index=other, index=pad, and index=pad-last are irrelevant and will never be used. Nothing to worry about here unless you modify the "wrap" settings, in which case you should recreate the loop using the Loop Wizard again.
In the second loop example, the code is accurate. Wrap is set to "2" with pad=true, meaning there will always be two results per row. In the case of an even number of results in the View, the wpv-item index=1 and wpv-item index=2 blocks will be rendered. That includes an opening tr and a closing tr. In the case of an odd number of results, index=1 and index=pad-last will be rendered. That includes an opening tr and a closing tr. So in either case, the number of opening and closing tr tags is correct.
Sorry for my late reply, I was on a business trip.
Okay, but it is odd. The editor indicates an error in both situations and in both situations there is a closing tag but no opening tag.
When you say it is okay, it is fine with me.
Cheers
Peter
The editor indicates an error in both situations
I agree it's a bit confusing because the code editor isn't smart enough to account for the index-based loop structure. I don't think you have anything to worry about here.
there is a closing tag but no opening tag.
Keep in mind that if there were more than 1 item, the first wpv-item would look like this:
[wpv-item index=1]
<div class="row ">
<div class="col-sm-12">[wpv-post-body view_template="Loop item in Blogs - voor persoonlijke teampag. (views)"]</div>
[wpv-item index=2]
...
You can see that in this case, the opening tag would be in the first wpv-item block, and that tag would be left open until the last item or the pad-last item. Then the extra closing div you see in the code now would make more sense.
Aha, clear so don't correct the errors in the loop editor, that is a bit tricky. Thanks for the explanation,
Great, let me know if you have problems with that, otherwise I believe we can close this ticket out.