Use <img tag with image inside theme folder

SOLVE
alexgulen
Member | Platinum Partner

For some fixed images in my Hubspot theme i want to add a simple <img tag with it's src pointing to an image inside the /images/ folder of the theme folder.

 

How do i get the right URL?  get_asset_url or something doesn't seem to work.

0 Upvotes
1 Accepted solution

Accepted Solutions
alexgulen
Solution
Member | Platinum Partner

The solution i was looking for is using the get_asset_url function.

For example <img src="{{ get_asset_url('../../images/image.jpg') }}" />

 

Make sure to set te correct path ( '../' or '../../' ) arrording to wich folder the html file is inside the theme folder structure.

View solution in original post

0 Upvotes
2 Replies 2
Anton
Key Advisor | Diamond Partner

Hi @alexgulen

if you place the fixed images in the design-manager you can right-click on it and select "copy path" and paste it directly into the src="" of your img-tag

 

 

best, 

Anton

 








check Did my post help answer your query? Help the Community by marking it as a solution
0 Upvotes
alexgulen
Solution
Member | Platinum Partner

The solution i was looking for is using the get_asset_url function.

For example <img src="{{ get_asset_url('../../images/image.jpg') }}" />

 

Make sure to set te correct path ( '../' or '../../' ) arrording to wich folder the html file is inside the theme folder structure.

View solution in original post

0 Upvotes