Hello.
I want to get diferent template for the view in a loop like this
[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-md-12">FIRST</div>
</div>
[wpv-item index=other]
<div class="col-md-12">OTHER</div>
[wpv-item index=pad]
<div class="col-md-12"></div>
[wpv-item index=pad-last]
<div class="col-md-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]
I think this is right but always shows FIRST in the loop. How can I get different content for the other items items?
Thanks!
Hi,
Thank you for contacting us and I'd be happy to assist.
When wrap="1" is used, it sets the index counter to '1', for every result in the loop.
The correct usage, in this case, would be:
[wpv-layout-start]
[wpv-items-found]
<!-- wpv-loop-start -->
<wpv-loop>
[wpv-item index=1]
<div class="row ">
<div class="col-md-12">
First
</div>
</div>
[wpv-item index=other]
<div class="row ">
<div class="col-md-12">
Other
</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]
I hope this helps and please let me know if you need any further assistance around this.
regards,
Waqar
My issue is resolved now. Thank you!