Magento2 : how can I call my theme images
-
04-10-2020 - |
Question
I am trying to convert some M1.9 emails to M2 and it currently calls the images from
<img src="{{skin url="images/logo_email.gif" _area='frontend'}}
I've tried
<img src="{{view url="images/logo_email.gif"}}
I have all the images in app/design/frontend/Vender/Theme/web/images. Is this the correct location?
It works if I pull from the media folder with <img src="{{media url="/wysiwyg/logo_email.gif"}}
, but I would really like to know how to pull from the theme folder in M2. I think it's a permissions issue as I cannot pull up any image from there.
Solution
Here are a few things to try:
First of all, you're missing the design/
folder in your location path. Move the files to `app/design/frontend/Vendor/Theme/web/images.
Next, try adding the theme name to as an argument to the view directive: {{view theme="yourtheme" url="images/logo_email.gif"}}
Also, make sure that you run bin/magento setup:static-content:deploy
.
Please let me know if you have any questions.