Forum

Thread tagged as: Question

First child of a repeater

I would like to use first image of this repeater on other page. How should I call it?

<perch:repeater id="carrusel-viaje" label="Carrusel de Fotos">
    <perch:before><div class="owl-carousel push"></perch:before>
        <div class="item">
            <img src='<perch:blog type="image" id="image-carrusel-viaje" label="Imagen" quality="70" crop="true" width="740" height="300" help="Se recorta a 740 x 300 px." />' alt='<perch:blog type="text" label="Descripción" id="texto-carrusel-viaje" help="Ayuda a que Google indexe las imágenes" />' />
        </div>
    <perch:after></div></perch:after>
</perch:repeater>
Raul Serrano

Raul Serrano 0 points

  • 5 years ago
Drew McLellan

Drew McLellan 2638 points
Perch Support

To only output the first item:

<perch:if exists="perch_item_first">
...
</perch:if>

Yo mean doing this on the template? (not in the post.html?)

<perch:if exists="perch_item_first">
     <div class="item">
            <img src='<perch:blog type="image" id="image-carrusel-viaje" label="Imagen" quality="70" crop="true" width="740" height="300" help="Se recorta a 740 x 300 px." />' alt='<perch:blog type="text" label="Descripción" id="texto-carrusel-viaje" help="Ayuda a que Google indexe las imágenes" />' />
        </div>
</perch:if>
Drew McLellan

Drew McLellan 2638 points
Perch Support

That's the only way to filter a repeater. They're not designed for filtering.