Forum

Thread tagged as: Question, Problem

Accessing one repeater item from another page

Hi,

I have created a php script that searches for all pages in it's directory, creating a variable with those url's. I then start a foreach loop containing a perch_content_custom pointing at a repeater template, outputting the images from that repeater.

Is there a query to only return the first item from a repeater?

Adam Menczykowski

Adam Menczykowski 1 points

  • 7 years ago
Drew McLellan

Drew McLellan 2638 points
Perch Support

Use a template with <perch:if exists="perch_item_first">

Oh! Thanks! Will try that out for sure!

Do I have to pass the id of the repeater somewhere?

This did it thanks


<perch:repeater id="slider" label="Portfolio images"> <perch:if exists="perch_item_first"> <perch:content type="image" id="case-study-image" label="Image" width="100" height="100" crop="true" /> </perch:if> </perch:repeater>