# srcset tag not being added

**URL:** <https://community.hubspot.com/t/srcset-tag-not-being-added/64506>\
**Category:** CMS Development\
**Created:** [September 6, 2022, 10:53am UTC](https://community.hubspot.com/t/srcset-tag-not-being-added/64506 "2022-09-06T10:53:23Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![marth](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/marth/32/7115_2.png) [@marth](https://community.hubspot.com/u/marth)\
**Post date:** [September 6, 2022, 10:53am UTC](https://community.hubspot.com/t/srcset-tag-not-being-added/64506/1 "2022-09-06T10:53:23Z")

</div>

I have recently created a custom slider module on hubspot. What I noticed is that when I am trying to preview a template that has that module, the srcset tag is present. But when I created a page using that template the srcset tag is no longer being added.  
Here’s the hubl code of the image on the custom module I made.

```lia-code-sample
{% set sizeAttrs = 'width="{{ item.image.width }}" height="{{ item.image.height }}"' %}
{% if item.image.size_type == 'auto_custom_max' %}
{% set sizeAttrs = 'width="{{ item.image.max_width }}" height="{{ item.image.max_height }}"' %}
{% endif %}
{% set loadingAttr = item.image.loading != 'disabled' ? 'loading="{{ item.image.loading }}"' : '' %}
<img src="{{ item.image.src }}" alt="{{ item.image.alt }}" {{ loadingAttr }} {{ sizeAttrs }}>

```

Here’s a screenshot of the image element on the Design Manager Preview:

 ![Screen Shot 2022-09-06 at 6.49.26 PM.png](https://d2qpr2jzcazej7.cloudfront.net/original/3X/b/2/b2ab09d5e9112527f42fd95df2559bbb7635ec6e.png)

Here’s a screenshot of the same image element when I created a page using that same template:

 ![Screen Shot 2022-09-06 at 6.49.51 PM.png](https://d2qpr2jzcazej7.cloudfront.net/original/3X/6/2/62e46fdb06b92ababc655999fcd4c181d579e7fc.png)

Any idea on why this is happening? Am I missing a code that triggers the srcset tag to work a published page?

---

<div class="post-metadata">

**Author:** ![Jaycee\_Lewis](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/jaycee_lewis/32/61352_2.png) [@Jaycee\_Lewis](https://community.hubspot.com/u/Jaycee_Lewis)\
**Post date:** [September 6, 2022, 8:40pm UTC](https://community.hubspot.com/t/srcset-tag-not-being-added/64506/2 "2022-09-06T20:40:23Z")

</div>

Hi, @marth 👋 Thanks for reaching out. Hey @piersg @Jnix284 @Indra, do you have any insight on the issue @marth is describing?

Thank you! — Jaycee

---

<div class="post-metadata">

**Author:** ![piersg](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/piersg/32/99782_2.png) [@piersg](https://community.hubspot.com/u/piersg)\
**Post date:** [September 7, 2022, 10:32am UTC](https://community.hubspot.com/t/srcset-tag-not-being-added/64506/3 "2022-09-07T10:32:41Z")

</div>

Hi @marth (thanks [@Jaycee\_Lewis](https://community.hubspot.com/t5/user/viewprofilepage/user-id/127074)) I believe this just an issue with propagation. Changes in code are reflected immediately in preview (possibly because there’s no cache of that?), whereas live the changes to longer to propagate. Give it a couple of minutes and hard refresh or check the page in incognito and you should see the srcset being applied.

---

<div class="post-metadata">

**Author:** ![marth](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/marth/32/7115_2.png) [@marth](https://community.hubspot.com/u/marth)\
**Post date:** [September 7, 2022, 11:48am UTC](https://community.hubspot.com/t/srcset-tag-not-being-added/64506/4 "2022-09-07T11:48:05Z")

</div>

Hi @piersg,  
Thank you for the response. The page has been published since last tuesday and the srcset is still not appearing.  
But what we noticed is that the srcset shows up on websites we worked on that is currently live right now. The website we are currently having the issue on is not yet live and is using the [portal\_id].hs-sites.com domain.  
Is it possible that the domain is causing the issue? We just want to know how the srcset is being added so we can make sure it is always being added.

---

<div class="post-metadata">

**Author:** ![piersg](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/piersg/32/99782_2.png) [@piersg](https://community.hubspot.com/u/piersg)\
**Post date:** [September 7, 2022, 12:54pm UTC](https://community.hubspot.com/t/srcset-tag-not-being-added/64506/5 "2022-09-07T12:54:01Z")

</div>

Hi @marth, that’s definitely it. Good catch. I just compared an image in the same module that is used on a live page and a staging page and the live version has the srcset applied, the staging version doesn’t.

---

<div class="post-metadata">

**Author:** ![marth](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/marth/32/7115_2.png) [@marth](https://community.hubspot.com/u/marth)\
**Post date:** [September 8, 2022, 1:27am UTC](https://community.hubspot.com/t/srcset-tag-not-being-added/64506/6 "2022-09-08T01:27:13Z")

</div>

Hi @piersg,  
I see. Thanks for clearing it up. Although it will be nice to see the srcset working on the staging page as well since the clients usually take a look at those before publishing it.
