https://www.suzannebirch . com/bird-originals
I created this page to show the works that are for sale, using a dataset / dynamic pages. Some images in the repeater are portrait, some landscape. Now they are all cropped in a really awkward way.
I have found the code to fix this from this page: https://www.wix.com /velo/reference/$w/image/src
And have figured out that I need to add this line of code: $w(“#Image1”).fitMode = “fit”;
Also I looked at all the very basic tutorials out there and on this forum, and I cannot work out how to add this code into my page so that it actually works. It seems to work when I click preview, however on my actual published website the images are still cropped awkwardly.
Please help, I’m going mad! Can anyone just give me the piece of code and tell me step by step where and how to put it, somewhere in the editor below?
Hi, sorry for the confusion and thanks for replying! I realise I might have given the wrong link and image - it is the screenshot below Im talking about, which is this page: https://www.suzannebirch.com/bird-originals . I seem to have both pages still active - the online shop as it was before, and the dynamic page option. But it’s the dynamic page that I want to keep, with the images placed in repeaters as below. What is the code I would need to fix the Imagefit in the repeaters, so that the middle image is shown properly?
Ok, now you are on the right track.
Now we know, that all of your images comes from a DATABASE (showed in a REPEATER), connected through a DATASET (placed on a DYNAMIC-PAGE).
in this here: $item(‘#myImageIDhere’).fitMode=“fit”
Is myImageIDhere the name of the actual JPEG image or file or are we talking how it’s numbered in the Content data? Sorry for the basic question.
@daniel3614
Your repeaters ID is → “repeater1” ?
And your repeater is connected to your dataset?
I see no connected images.
You have also stored some images inside your DATABASE, which is connected to your REPEATER trough a DATASET ?
@russian-dima Yes. All of my images are connected through a dataset. The repeater is called repeater1. The images won’t show up unless I’m in preview mode which is why it looks blank. Am I not able to fit an image connected through a dataset?