Thread tagged as: Question

Page attributes in navigation - Image size


I've created the following page attribute:


<perch:pages type="image" id="casestudy_thumb" label="Thumbnail" width="250" height="250" crop="true" suppress="true" divider-before="Case Study Thumbnail" />

I've then added this attribute to a custom navigation:


<a href="<perch:pages id="pagePath" />"><img src="<perch:pages id="casestudy_thumb" encode="false" />" alt=" " /> <perch:pages id="pageNavText" /></a>

The image is displayed but at full size, not the cropped size set in the page attribute 250x250px. Can I change this?

Many thanks Michael

Michael Grinstead

Michael Grinstead 0 points

  • 6 years ago

Hello Michael

I’ve done something similar, try using:

<a href="<perch:pages id="pagePath" />"><img src="<perch:pages type="image" id="casestudy_thumb" width="250" height="250" crop="true" />" alt=" " /> <perch:pages id="pageNavText" /></a>

You might only need the width and not the height and crop too, but using them all should make sure it matches.

Hope that helps


Drew McLellan

Drew McLellan 2638 points
Perch Support

That's it - the sizing options need to match so that Perch can find the right version of the image.

Thank you Nick & Drew, that did the trick.