Showing results for 
Search instead for 
Did you mean: 

Using theme image in module .phtml template

Using theme image in module .phtml template



I'm trying to include an image from my themes web/images folder inside a module override.


I have an image in my theme folder:



I am wanting to add this image inside a Magento_Theme template override:



I've tried adding the following to the logo.phtml, without success:


img src="<?php echo $block->getSkinUrl('images/amazing.jpg'); ?>" />

but on render the src is empty.


I've also tried using Mage::getDesign()->getSkinUrl('images/amazing.jpg');?> />


but this causes a compile error saying "Mage class not found in .... "


So maybe that was how to do it in version 1.  Can someone teach me how to put an image inside a module thats in the themes directory?


Re: Using theme image in module .phtml template

How to get the URL of an internal static asset located inside of a module's or theme's web folder in the context of a block's *.phtml template?: