Reputation: 3772
I'm trying to display an image in my phtml file but I can't seem to load this. Below is my code
<!--- Location: /app/design/frontend/Vendor/Module/Magento_Theme/templates/html/custom-page.phtml -->
<div>
<img src="{{view url='images/v3.jpg'}}"/>
</div>
Now the image I'm trying to load is located in
/app/design/frontend/Vendor/Module/web/images/v3.jpg
But I can't seem to be able to load this image. Any idea guys?
Upvotes: 0
Views: 2968
Reputation: 21
<img src="<?= $this->getViewFileUrl('Vendor_Module::images/filename.png'); ?>"> //phtml
<img src="{{view url='Vendor_Module::images/image.png'}}"/> //cms block/ cms page
<img src="<?= $block->getViewFileUrl('images/filename.png'); ?>" /> //phtml
<img src="{{view url='images/image.png'}}"/> //cms block/ cms page
Upvotes: 2