CMS Development

alexgulen
Membre | Partenaire solutions Platinum
Membre | Partenaire solutions Platinum

Use <img tag with image inside theme folder

Résolue

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 Votes
1 Solution acceptée
alexgulen
Solution
Membre | Partenaire solutions Platinum
Membre | Partenaire solutions Platinum

Use <img tag with image inside theme folder

Résolue

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.

Voir la solution dans l'envoi d'origine

0 Votes
2 Réponses
alexgulen
Solution
Membre | Partenaire solutions Platinum
Membre | Partenaire solutions Platinum

Use <img tag with image inside theme folder

Résolue

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 Votes
Anton
Expert reconnu | Partenaire solutions Diamond
Expert reconnu | Partenaire solutions Diamond

Use <img tag with image inside theme folder

Résolue

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 Votes