Pregunta

I uploaded the image amazon-pay-ic.svg to THEME/web/images/.

How can I load it in the frontend? I tried www.example.com/images/amazon-pay-ic.svg but it does not work and shows the 404 site.

¿Fue útil?

Solución

<img src="{{view url="images/amazon-pay-ic.svg"}}" alt="test" /> inside PHTML templates, then flush full_page and block_html caches.

For HTML templates use this:

<img data-bind="attr: { src: require.toUrl('images/amazon-pay-ic.svg') }" alt="test" />

Licenciado bajo: CC-BY-SA con atribución
No afiliado a magento.stackexchange
scroll top