CMS Development

alexgulen
Member | Platinum Partner
Member | Platinum Partner

Use <img tag with image inside theme folder

SOLVE

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
alexgulen
Solution
Member | Platinum Partner
Member | Platinum Partner

Use <img tag with image inside theme folder

SOLVE

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
alexgulen
Solution
Member | Platinum Partner
Member | Platinum Partner

Use <img tag with image inside theme folder

SOLVE

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.

0 Upvotes
Anton
Recognized Expert | Diamond Partner
Recognized Expert | Diamond Partner

Use <img tag with image inside theme folder

SOLVE

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

 

Anton Bujanowski Signature
0 Upvotes