Display image with code

I have code that displays content from a cms collection. However i can not get the images to display (the default image displays). I assume I need to change the type from “text” to something different to get it to work.

Attached our some ss.

Many thanks


Use .src (source)

$w('#image2').src = itemData.idBuyer21;
1 Like

Why did you connect everything manually via code?

Why not use the data connect icon?

Hey Steve,

That got rid of the red line. However it is still only displaying the default image and not pulling the image from the CMS?

Not sure, just the way the coder set it up.

It links to a trigger email automation.

What you are connecting is a repeater. It has nothing to do with a triggered email that gets sent from the backend.

Number 3 from this Wix help article will show you how to connect without code.

Never mind that worked! Just had to change the field from mulit gallery to image. thanks Steve!

1 Like