Thumbnail Image aspect Ratio
-
Hi there,
Having done multiple websites with Laytheme, a thing I always stumble upon is that the thumbail grid is not automatically cropping images to a certain aspect ration.
That means, if you want to have a clean thumbnail grid, you need to upload for each image an extra cropped thumbnail version.
Would be pretty dope if you could set an aspect ration for thumbnails in the settings!Thank and have great day,
Marius -
Dear @ml
This is a great idea and we will write it down for the future. Right now this is not possible.
Thank you!
Marius -
Would love this, very useful :)
-
-
Enter this css in "lay options" -> "custom css & html" -> "custom css":
.thumb-collection .ph{ padding-bottom: 100%!important; } .thumb-collection .ph img, .thumb-collection .ph video{ width: 100%!important; height: 100%!important; object-fit: cover!important; object-position: center!important; }this way you will have a thumbnailgrid of just squares.
change the padding-bottom to change the aspect ratio.to have a 16/9 aspect, you would calculate:
9 / 16 * 100 = 56,25
would be:
padding-bottom: 56,25%!important;and u may want to read this
https://developer.mozilla.org/en-US/docs/Web/CSS/object-positionabout the object position css
-
Thanks Armin,
Worked like a charm, would be very useful if there would a way in the future to control it via the Thumb\Element grid visual interface...I've also implemented it for Element Grid:
.elements-collection-region .ph{
padding-bottom: 100%!important;
}.elements-collection-region .element-wrap img,
.elements-collection-region .element-wrap video{
width: 100% !important;
height: 100% !important;
object-fit: cover !important;
object-position: center !important;
} -
R robsdonatini referenced this topic on
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better 💗
Register Login