Forum

Thread tagged as: Question, Problem

Images not outputting images as expected

Hi there,

I have the following content template for a set of images in a repeater, on one page I wanted to show an image that is a max of 248px OR a max height of 248px and not crop the image, however in a different page I want to show an image that is 250px x 250px and cropped.

I thought that this template code would do this:

<perch:repeater id="artist_images" label="Artist Images">

<li>
  <span></span>
  <a href="<perch:content type="image" id="image" label="Image" bucket="artists" width="1000" />">
    <img src="<perch:content type="image" id="image" label="Image" width="248" height="248" />" alt="" data-title="<perch:content type="text" id="title" label="Artwork Title" required="true" />" data-desc="<perch:content type="text" id="alt" label="Description" required="true" help="e.g. 300cm x 300cm Oil on canvas" />" />
    <div class="hover"><h3><perch:content type="text" id="title" /></h3></div>

    <perch:content type="image" id="image" label="Image" width="250" height="250" crop="true" suppress="true" />
  </a>


</li>

</perch:repeater>

However on the img tag in this code, perch is outputting an image that is 248x248px and cropped in the repeater code on the front end.

Am I doing something wrong here, or is the output as expected??

Matt

Matt Bee

Matt Bee 0 points

  • 6 years ago
Matt Bee

Matt Bee 0 points
Registered Developer

Hi there,

I tried removing all the images and basically starting the page again, using fresh images - it seems that by editing the template and using existing assets to create the page while editing the template didn't output the images as expected - but after clearing out the assets and starting with the template as it is above, everything worked as expected!

Might be useful for you to know about what I experienced - but it seems to be working now.

Matt

Drew McLellan

Drew McLellan 2638 points
Perch Support

Thanks, I'll take a look at it.