Blog > showing posts on home page (with different image ratio)

  • Hi all,


    So I've got the blog all set up. I'm showing my posts on the blog/news page and I'm using perch_blog_custom to show the title, image and excerpt on the home page.


    My question is, is there a way to crop the image on the home page to a different size to that of the main blog post? I need the main blog image to be square (which I have got) and the home page image to be 2:1 ratio.....


    I am using different templates for each. So "post_in_list.html" for the blog page and "homepage_post_in_list.html" for the home page and have set the image to be cropped to the sizes I want to have. But I'm getting all squared images...


    Thanks!

  • Pete

    Changed the title of the thread from “Blog > showing posts on home page (with different image)” to “Blog > showing posts on home page (with different image ratio)”.
  • drewm

    Approved the thread.
  • Perch generates the different image sizes when you save an edit form. So in your post edit template (default is post.html), include additional tags to generate the image sizes you need. You can add the suppress attribute if you don't need to output these versions from this template:


    HTML
    1. <perch:blog id="image" type="image" label="Image">
    2. <perch:blog id="image" type="image" width="800" height="400" crop suppress>
    3. <perch:blog id="image" type="image" width="320" height="240" crop suppress>