CMS Development

AFlow
Member

How to pull a custom module's src?

I have a custom module on my blog post template(shared with the listing template). 

This custom module allows me to select an image. 
Screen Shot 2021-11-26 at 4.51.24 PM.png

I'd like to then pull this image src while in my listing content loop for the posts, essentially pulling this image instead of the featured image. I have tried
{{ content.widgets.listing_image.src }} and a few variations of this but no luck. 

What am I missing here? 

0 Upvotes
2 Replies 2
AFlow
Member

How to pull a custom module's src?

I gave that a go but still no luck. Just to check that I am calling it correctly:

Screen Shot 2021-11-28 at 6.30.15 PM.png

 

In the test above, I am just trying to get it to output anything, in this instace just the url into the CSS class as that won't visually affect the live page but I can see the result with the inspector tool. 

0 Upvotes
Teun
Recognized Expert | Diamond Partner
Recognized Expert | Diamond Partner

How to pull a custom module's src?

Hi @AFlow ,

 

Could you try to use the following snippet:

{{ content.widgets.listing_image.body.src }}

If I'm not mistaken, you need to include the .body to access the source.



Learn more about HubSpot by following me on LinkedIn or YouTube

Did my answer solve your issue? Help the community by marking it as the solution.