Page 1 of 1
Photo collage issue with aspect ratio.
Posted: Tue Nov 09, 2021 11:01 pm
by alan_sh
I want to have a page with a photo collage of 30+ files. No issue, except that the photos seem to be resized to fit the boxes rather than the other way round. So, the aspect ratios make the photos look too wide or too tall.
A demo file can be found here
https://www.dropbox.com/s/n3t733lgm6tin ... e.zip?dl=1. So what have I done wrong?
Alan
Re: Photo collage issue with aspect ratio.
Posted: Wed Nov 10, 2021 12:19 am
by crispy68
All of the images in the collage are squares thus the image is being squashed to fit. There is nothing in the extension to change this behavior.
However, CSS crispy68 to the rescue!
Enter the following between the <head> tags:
Code: Select all
<style>
#PhotoCollage1 .thumbnail img{object-fit:cover;}
</style>
Make sure to change "PhotoCollage1" to match the name of your ID.
Re: Photo collage issue with aspect ratio.
Posted: Wed Nov 10, 2021 10:06 am
by alan_sh
Thank you. I will try that.
Alan
Re: Photo collage issue with aspect ratio.
Posted: Wed Nov 10, 2021 11:23 am
by alan_sh
That works just fine. My only issue now is that if I fit it into a layout grid, it goes to full width. There doesn't seem to be any way to set full width=false.
I've fixed it for now by putting in 3 cells in my layout grid and putting the collage in the middle one.
Alan
Re: Photo collage issue with aspect ratio.
Posted: Wed Nov 10, 2021 1:08 pm
by crispy68
it goes to full width.
This is correct and intended behavior so it can be flexible. Why didn't you just add a max-width to the grid?
Re: Photo collage issue with aspect ratio.
Posted: Wed Nov 10, 2021 6:11 pm
by alan_sh
Because I didn't think of it (doh!!). Having said that, I actually like it the way I've done it.
Cheers
Alan