Forum
Image cropping not working in this instance...
I have the template that is part of a perch: blocks region:
<perch:block type="cruise_photos" label="Cruise Photos" icon="photos">
<div class="detail-top slider-wth-thumbs style-1 arrows">
<div class="swiper-container thumbnails-preview" data-autoplay="0" data-loop="1" data-speed="500" data-center="0" data-slides-per-view="1">
<div class="swiper-wrapper">
<perch:repeater id="cruise_photos" label="Cruise Photos">
<div class="swiper-slide <perch:if exists="perch_item_first">active</perch:if>" data-val="<perch:content id="perch_item_zero_index" type="hidden" />">
<img class="img-responsive img-full" src="<perch:content id="cruise_photo" type="image" label="Cruise Photo Images" width="770" height="455" crop="true" />" alt="">
</div>
</perch:repeater>
</div>
<div class="pagination pagination-hidden"></div>
<div class="arrow-wrapp arr-s-3">
<div class="swiper-arrow-left sw-arrow"><span class="fa fa-angle-left"></span></div>
<div class="swiper-arrow-right sw-arrow"><span class="fa fa-angle-right"></span></div>
</div>
</div>
<div class="swiper-container thumbnails" data-autoplay="0"
data-loop="0" data-speed="500" data-center="0"
data-slides-per-view="responsive" data-xs-slides="3"
data-sm-slides="5" data-md-slides="5" data-lg-slides="5"
data-add-slides="5">
<div class="swiper-wrapper">
<perch:repeater id="cruise_photos" label="Cruise Photos">
<div class="swiper-slide <perch:if exists="perch_item_first">current active</perch:if>" data-val="<perch:content id="perch_item_zero_index" type="hidden" />">
<img class="img-responsive img-full" src="<perch:content id="cruise_photo" type="image" label="Cruise Photo Images" width="154" height="101" crop="true" />" alt="">
</div>
</perch:repeater>
</div>
<div class="pagination hidden"></div>
</div>
</div>
</perch:block>
What's happening is that in the first instance of the repeater with ID="cruise_photos", I'm getting images without the width and height as part of their filename (/perch/resources/p1030677.jpg) and in the second instance of the same repeater the image names are getting the width and height as part of their filename correctly (/perch/resources/img2620-w154h101.jpg).
If you notice, I was trying to have the images display twice by calling the repeater twice, first with the larger cropped version, and the second time with the cropped thumbnail.
Wondering if this would be a method that should work, where the repeater is referenced twice.
The Diagnostics...
In theory the second instance of the repeater will not be taken into account when editing.
In reality, it's the other that's happening...
So I should handle this differently, right? not a bug?
If your template is complex it might be best to have a simplified version as the master, and a more complex one for display.
Got it. Have an edit template with just the image calls in a repeater and then a display block with two instances of the repeater and I'm all set! Thanks!