# Issue with accessing alt for image

**URL:** <https://community.hubspot.com/t/issue-with-accessing-alt-for-image/112049>\
**Category:** CMS Development\
**Created:** [July 16, 2024, 8:34am UTC](https://community.hubspot.com/t/issue-with-accessing-alt-for-image/112049 "2024-07-16T08:34:10Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![RKrohne](https://avatars.discourse-cdn.com/v4/letter/r/6f9a4e/32.png) [@RKrohne](https://community.hubspot.com/u/RKrohne)\
**Post date:** [July 16, 2024, 8:34am UTC](https://community.hubspot.com/t/issue-with-accessing-alt-for-image/112049/1 "2024-07-16T08:34:10Z")

</div>

Hello,

I’m struggling to access the alt information for the image inside the files.  
Here’s my markup:

\<img class=“logo-blob” src=“{% image\_src “client\_logo”, label=“Client Logo”, src=”{{ get\_asset\_url(‘/xebia-theme/images/logo01.svg’) }}“, no\_wrapper=True %}” alt=“”\>

The place of the image is inside the files and it has alt attribute assigned. I’m really struggling to access this data. Does anybody can help, please?

 ![Screenshot 2024-07-16 at 10.32.16.png](https://d2qpr2jzcazej7.cloudfront.net/original/3X/1/c/1c90d77911749eac8cb53d15812ecac7a430947b.png)

---

<div class="post-metadata">

**Author:** ![Anton](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/anton/32/103167_2.png) [@Anton](https://community.hubspot.com/u/Anton)\
**Post date:** [July 16, 2024, 10:42am UTC](https://community.hubspot.com/t/issue-with-accessing-alt-for-image/112049/2 "2024-07-16T10:42:26Z")

</div>

Hi @RKrohne,

there are a few things you should consider:

- {% image %} tags do not need to be placed inside an ![]()-tag
- {{ get\_asset\_url }} won’t get you the alt-text since it’s providing only the URL
- {{ get\_asset\_url }} won’t get you data from the file-manager unless you put the whole URL into it and - therefore make the get\_asset\_url more or less obsolete 😉
- {{ get\_asset\_url }} is used inside themes for theme files that are located inside the theme-folder

If you want to display a default image of a module, write your code like this:

`{% module 'SOME-NAME' path="@hubspot/linked_image" img={"alt":module.image.alt, "src": module.image.src or get_asset_url("PATH-TO-IMAGE")}%}`

My personal recommendation would be to create a custom module which gives you unlimited possibilites in terms of customization. This could be a great start:

```lia-code-sample
{% if module.image.src %}
 <img src="{{ module.image.src }}" alt="{{ module.image.alt }}" class="customClass">
{% endif %}

```

best,

Anton

_Moderator note: While this solution may not address the original poster’s specific situation, it could be helpful for other community members facing similar challenges._

---

<div class="post-metadata">

**Author:** ![RKrohne](https://avatars.discourse-cdn.com/v4/letter/r/6f9a4e/32.png) [@RKrohne](https://community.hubspot.com/u/RKrohne)\
**Post date:** [July 17, 2024, 8:34am UTC](https://community.hubspot.com/t/issue-with-accessing-alt-for-image/112049/3 "2024-07-17T08:34:47Z")

</div>

Hello @Anton,

Thank yoy very much for your response. I was trying your solution in many different ways but I still cannot access the image data.  
The best way to access data is through this line:

`{{ content.widgets.client_logo }}`

But I still don’t get the alt data:

```lia-code-sample
 {body={src=https://697348.fs1.hubspotusercontent-na1.net/hubfs/697348/Anonymous%20Icon.svg}, css={}, child_css={}, id=client_logo, name=client_logo, type=image_src, order=8, smart_type=null, styles={}}

```
