How to view image on a view
Created 5 years ago by dilusha100

My module has image and I need to show it in the index page. basically I tried to use {{ package.image.make.class("card-img-top").fit(300,300) | raw }} it doesn't show anything ( there is no error also). First I though this is a problem with users permission on his role but then I realize that even admin can't see the images.

So, I'm I in correct path or is there any better way to do this?

dilusha100  —  5 years ago Best Answer

Thank you for your support. But it's not worked for me. but I found this as solution <img src="/files/images/{{ package.image.name}}" alt="">

edster  —  5 years ago

you need to add .render or image to the end of that to actually output via the presenter. Otherwise you are just modifing the image object without outputting.

dilusha100  —  5 years ago Best Answer

Thank you for your support. But it's not worked for me. but I found this as solution <img src="/files/images/{{ package.image.name}}" alt="">