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!
Oezcan
February 10, 2022, 8:39am
2
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.
or just write a module that you use as your header.
I hope I could help, best regards,
Özcan
system
February 10, 2022, 9:51am
3
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.