CMS Development

alexgulen
Mitglied | Platinum Partner
Mitglied | Platinum Partner

Use <img tag with image inside theme folder

lösung

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 Akzeptierte Lösung
alexgulen
Lösung
Mitglied | Platinum Partner
Mitglied | Platinum Partner

Use <img tag with image inside theme folder

lösung

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.

Lösung in ursprünglichem Beitrag anzeigen

0 Upvotes
2 Antworten
alexgulen
Lösung
Mitglied | Platinum Partner
Mitglied | Platinum Partner

Use <img tag with image inside theme folder

lösung

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
Trendsetter/-in | Diamond Partner
Trendsetter/-in | Diamond Partner

Use <img tag with image inside theme folder

lösung

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