I have an image in:


How can I refer to this image in CMS block? I know I should use:

<img src="{{media url="..."}}" alt="" />

What shall I put instead of "..." ?


  1. Use Of {{view url=""}}

You have to use view url like below for all images are coming from theme folder,


{{view url="images/natale/IMG_7300.JPG"}}

You can use in your static block or page using below way,

<img src="{{view url="images/natale/IMG_7300.JPG"}}" alt="" />

  1. Use Of {{media url=""}}

For All images That are coming from pub/media folder,

path like, pub/media/customfolder/imagename.jpg at that time use media url.

You have to use {{media url="customfolder/imagename.jpg"}}

<img src="{{media url="customfolder/imagename.jpg"}}" alt="" />

  • 3
    to add an explanation {{media}} directive works only for assets located in the media folder.
    – Marius
    Dec 13 '16 at 10:13
  • @Marius, ok sure, i will explain in more. Thanks. Dec 13 '16 at 10:15
  • @Marius, I have updated my answer. Dec 13 '16 at 10:27

Not the answer you're looking for? Browse other questions tagged or ask your own question.