Forum

Thread tagged as: Question, Problem, Blog

Problem with resizing image

Hi there

I am using the Blogs app as a business directory.

In my post.html I have the following, which is working well to re-size the image to 640px wide

<perch:if exists="image"><img class="business" src="<perch:blog id="image" type="image" width="640" label="Business photo 1" order="4" />" alt="<perch:blog id="postTitle" />" /></perch:if>

^ https://lovebedfordbusinesses.co.uk/businesses/business.php?s=test

However, my issue is, I'm using post_list_html.php to display the following: https://lovebedfordbusinesses.co.uk

div class="container">



    <a href="<perch:blog id="postURL" />">

    <perch:if exists="image"><img src="<perch:blog id="image" type="image" label="Image" width="220" />" alt="<perch:blog id="postTitle" />" /></perch:if></a></div>




    <div id="section-top-left-medium-header"><h2 class="offer"><a class="white" href="<perch:blog id="postURL" />"><perch:blog id="postTitle" /></a></H2></div>
    <!--<p class="offer"><perch:blog id="Short" encode="false" /></p>-->
    <div class="button3"><strong><a class="view-all-link3" type="button" href="<perch:blog id="postURL" />">» View business</a></strong></div></div>

Which is displaying the image fine, BUT it's using the original file image upload, which is going to be bigger than 640px and therefore a large file size...

https://lovebedfordbusinesses.co.uk/perch/resources/dscn0307.jpg

I hope that makes sense!

Thanks in advance.

Rich

Rich Hemery

Rich Hemery 0 points

  • 6 years ago
Drew McLellan

Drew McLellan 2638 points
Perch Support

Add this somewhere in your post.html

<perch:blog id="image" type="image" label="Image" width="220" suppress="true" />