Forum

Thread tagged as: Question

Image for search not cropping

The search result image is not cropping.

Content template

<perch:content type="image" id="RevDetailsPageSliderImg" label="Image" width="1920" height="1080" crop="true" bucket="headers_hero" order="1" divider-before="Hero image" />

<perch:search type="image" id="RevDetailsPageSliderImg" label="Image" width="400" height="250" crop="true" type="hidden" suppress="true"/>

Search result template

<perch:search type="image" id="RevDetailsPageSliderImg" />"  alt="<perch:search id="RevSubDetailspageH1Title" type="text" label="Main H1 Title" />

The search result image is not being cropped. Dunno if i'm missing something

Edward Johansen

Edward Johansen 0 points

  • 1 week ago
Drew McLellan

Drew McLellan 2591 points
Perch Support

It looks like you're missing the size attributes. Without specifying which size you want, the full size version will be displayed.

I have added the size attribute in search result, No joy. Still showing the image original size. Any ideas?

<img src="<perch:search type="image" id="RevDetailsPageSliderImg" width="400" height="225" crop="true" />"  alt="<perch:search id="RevSubDetailspageH1Title" type="text" label="Main H1 Title" />">
Drew McLellan

Drew McLellan 2591 points
Perch Support

Do you have a perch:search tag in your content template, or was that a typo?

In my content template, I have:

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

Typo on first

Dohhh, Removing the "type="hidden" worked.

Edward Johansen said:

In my content template, I have:

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

Typo on first