Line item image - how do I implement it?

Hello!

I’m an amateur coder and I’m trying to build my own quote template using HubSpot Designer.

I’m currently trying to code a module listing line items, and I want to show the image (“Image URL”) for the line items.

I tried using the following code, but this does not work:

Note that the following code is included in a for-loop that goes through all the line items one at a time

<img class=“line-items__image” style=“max-width: 150px; height: auto;” src=“{{ unit[item.hs_images] }}” />

The result is no image is shown whatsoever.

What am I doing wrong?

Cheers

Hi @KJonsson,

What isthe part ‘Unit[]’ for?

I think you can just output {{ item.hs_images }} or a version of it.

to display the output for a custom module, I recommend copy the snippet from the ‘action’ panel. See a sample below.

After you have copied the snippet this. past it into the HTML and adjust your HTML like you would want to.

Yep, I was simply confused because “item” was replaced by “unit” in a for loop I was using as reference.

Thanks! Sorted it out.