# Pull img src variable from blog post module into blog listing page

**URL:** <https://community.hubspot.com/t/pull-img-src-variable-from-blog-post-module-into-blog-listing-page/27560>\
**Category:** CMS Development\
**Tags:** content\
**Created:** [November 3, 2020, 7:24pm UTC](https://community.hubspot.com/t/pull-img-src-variable-from-blog-post-module-into-blog-listing-page/27560 "2020-11-03T19:24:26Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![iliascarre](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/iliascarre/32/81718_2.png) [@iliascarre](https://community.hubspot.com/u/iliascarre)\
**Post date:** [November 3, 2020, 7:24pm UTC](https://community.hubspot.com/t/pull-img-src-variable-from-blog-post-module-into-blog-listing-page/27560/1 "2020-11-03T19:24:26Z")

</div>

I am essentially trying to pull the image src variable from a custom image module in a blog post into the blog post listing page.

**From Blog post Listing module:**

\<img src=“{{ module.post\_listing\_image.src }}”\>

**In the single blog post template:**  
{% block body %}  
{# Image for Listing Page #}  
{% module “module\_160434676630624” path=“/client\_theme/modules/Blog-Post-Listing-Image”, label=“Blog-Post-Listing-Image” %}  
{# END Image for Listing Page #} …

**In the blog listing template I have tried various things. Here is the gist of what I am attempting (to spare you all the attempted methods):**

\<div class=“blogpostlisting\_\_listing”\>  
{% for post in contents %}

\<div class=“blogpostlisting\_image”\>

\<img src=“{{ post.module\_160434676630624.post\_listing\_image.src }}”\>

\</div\>

{% endfor %}

Any help would be appreciated. Thank you!

---

<div class="post-metadata">

**Author:** ![alyssamwilie](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/alyssamwilie/32/2072_2.png) [@alyssamwilie](https://community.hubspot.com/u/alyssamwilie)\
**Post date:** [November 3, 2020, 10:37pm UTC](https://community.hubspot.com/t/pull-img-src-variable-from-blog-post-module-into-blog-listing-page/27560/2 "2020-11-03T22:37:19Z")

</div>

There’s actually a recent post answering this very question :  
[https://community.hubspot.com/t5/CMS-Development/Using-a-custom-module-field-for-blog-post-in-the-listing/m-p/337246](https://community.hubspot.com/t5/CMS-Development/Using-a-custom-module-field-for-blog-post-in-the-listing/m-p/337246)

You had it quite close, believe you’re just missing the ‘widgets’ and ‘body’ bit:

`{{ post.widgets.module_160434676630624.body.post_listing_image.src }} `

---

<div class="post-metadata">

**Author:** ![iliascarre](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/iliascarre/32/81718_2.png) [@iliascarre](https://community.hubspot.com/u/iliascarre)\
**Post date:** [November 4, 2020, 3:14am UTC](https://community.hubspot.com/t/pull-img-src-variable-from-blog-post-module-into-blog-listing-page/27560/3 "2020-11-04T03:14:17Z")

</div>

@alyssamwilie Excellent! I saw that post some time after I posted this and was still tweaking my syntax to try and get it to work. It is working now. Thank you!
