Thumbnail is not working,

Tried to create thumbnails for my gallery, pages/01.gallery, but i coudn’t make it work, is there anything wrong with my code ?
{% for portfolio in page.header.images %}



  • {{ page.media[portfolio.image].thumbnail(‘default’).display(‘thumbnail’).html(‘Sample Image’) }}



    Title #0

    Description



  • {% endfor %}

    Did you provide a thumbnail file in the format: my_original.jpg.thumb.jpg assuming the regular image is called my_original.jpg ?

    Then you would access this via:

    {{ page.media['my_original.jpg'].thumbnail.html }}
    

    Also you don’t actually need to provide a thumbnail, you can create one dynamically with the media functions:

    {{ page.media['my_original.jpg'].cropResize(100,100).html }}
    
    1 Like

    i thought page.media[portfolio.image].thumbnail(‘default’).display(‘thumbnail’).html(‘Sample Image’) }}
    is sufficient to make a thumbnail, (didn’t find any documentation) and thanks, i followed your second method and it worked.

    1 Like

    How to make all the cropped images same size, what if some images has different aspect ratio ?

    Documentation for all the media methods is here. You might want to look at cropZoom