Image tag not working

bholsey
Member

Hello,

 

I am trying to put an image into my header file, but the {% image %} tag is not working. Here is my full tag: 

{% image "image" label="Header Image", alt="Header Image", src="../../images/home-illustration@2x.png" %}
 
It is not generating an area to edit the image, nor is it populating the image on the page. (See screenshot)
 
However, if i change the code to image_src the global content editor recognizes the field and an area to edit shows up. I dont want to use image_src though. I just want to use image. Any help would be much appreciated!
Screen Shot 2022-02-09 at 1.38.23 PM.png
0 Upvotes
1 Accepted solution
Oezcan
Solution
Top Contributor | Diamond Partner
Top Contributor | Diamond Partner

Hello @bholsey ,


there are a few other options, either with a default module or with a custom module

This is the default module:

{% module "linked_image" path="@hubspot/linked_image" 
"src": "https://static.hubspot.com/final/img/content/email-template-images/placeholder_200x200.png",
"alt": "placeholder_200x200",
"loading": "disabled",
"width": 200,
"height": 200
%}

 

and if you want a custom module you have to create/write a module with an image field and include them to your header.

Oezcan_0-1644481905275.png

Oezcan_1-1644481981426.png

Oezcan_2-1644482007136.png

Oezcan_3-1644482112503.png

 

or just write a module that you use as your header.

 

I hope I could help, best regards,

Özcan

 

 

 

Oezcan Eser Signature

View solution in original post

2 Replies 2
webdew
Guide | Platinum Partner
Guide | Platinum Partner

Hi @bholsey ,

If you are using here a module then you need to add a module path like this

 

For HubSpot image module

 

{% module path='@hubspot/image',

img={

'alt': 'image',

'size_type': 'auto',

'src': get_asset_url('../images/home-banner.svg') or "imageUrl": "https://example.com/path/to/image.jpg"

}

%}

{% end_dnd_module %}


If you using a custom module then you need to add here the path like

 

{% module "image-module" path="/project-theme/modules/image-module"

img={

'alt': 'image',

'size_type': 'auto',

'src': get_asset_url('../images/company.png') or "imageUrl": "https://example.com/path/to/image.jpg"

}

%}

 

If you adding it statically then you can add it as

 

<img src="/images/company.png" alt="">


Hope this helps!
If we were able to answer your query, kindly help the community by marking it as a solution.
Thanks and Regards.

0 Upvotes
Oezcan
Solution
Top Contributor | Diamond Partner
Top Contributor | Diamond Partner

Hello @bholsey ,


there are a few other options, either with a default module or with a custom module

This is the default module:

{% module "linked_image" path="@hubspot/linked_image" 
"src": "https://static.hubspot.com/final/img/content/email-template-images/placeholder_200x200.png",
"alt": "placeholder_200x200",
"loading": "disabled",
"width": 200,
"height": 200
%}

 

and if you want a custom module you have to create/write a module with an image field and include them to your header.

Oezcan_0-1644481905275.png

Oezcan_1-1644481981426.png

Oezcan_2-1644482007136.png

Oezcan_3-1644482112503.png

 

or just write a module that you use as your header.

 

I hope I could help, best regards,

Özcan

 

 

 

Oezcan Eser Signature