Forum
Perch:if for Repeater number of items
Is there a way I can get a list of numbers to appear based on the number of items in my repeater? See my code I currently have which fails:
<div class="row">
<ul class="col list-inline">
<perch:if id="perch_item_index" match="eq" value="1"><li><a href="#section1/slide1">01</a></li></perch:if>
<perch:if id="perch_item_index" match="eq" value="2"><li><a href="#section1/slide2">02</a></li></perch:if>
<perch:if id="perch_item_index" match="eq" value="3"><li><a href="#section1/slide3">03</a></li></perch:if>
<perch:if id="perch_item_index" match="eq" value="4"><li><a href="#section1/slide3">04</a></li></perch:if>
<perch:if id="perch_item_index" match="eq" value="5"><li><a href="#section1/slide5">05</a></li></perch:if>
</ul>
</div><!-- END ROW -->
</div><!-- END PANEL -->
</div>
<perch:repeater id="horizontalslides" label="Project gallery" scope-parent="true" output="count">
<div class="slide" data-anchor="slide<perch:content id="perch_item_index" type="hidden" />" >
<div class="fp-bg" style="background-image: url(<perch:content type="image" id="slideimage" label="Slide image" width="1500">)"></div>
</div>
<!-- END SLIDE -->
</perch:repeater>
You can use
perch_item_count
in the repeater to get the count of the number of items, I think. Do you see it with<perch:showall>
?That worked - Thanks
I had to wrap the list inside the repeater though.