Magento - add image to phtml
<img src="<?php echo $this->getSkinUrl('images/cassa/banner-overlay.png') ?>" alt="" id="banner-overlay" />
This is a collection of all those little and large genius moments you get. You know what I'm talking about, when you've spent hours searching the internet for a solution, but no one quite knows the while answer. Then you crack it and feel like you've accomplished lifting a mountain from your path.
Showing posts with label phtml. Show all posts
Showing posts with label phtml. Show all posts
Friday, 9 December 2011
Wednesday, 3 August 2011
Magento Referencing a Static Block in a *.phtml file
use this snippet of code replacing 'IDENTIFIER' with the ID of your Static Block:
<?php echo $this->getLayout()->createBlock('cms/block')->setBlockId('INDENTIFIER')->toHtml() ?>
Reference in XML
XML Ref
phtml Ref
<?php echo $this->getChildHtml('**REFERENCED IN phtml**') ?>
click here for the original website
<?php echo $this->getLayout()->createBlock('cms/block')->setBlockId('INDENTIFIER')->toHtml() ?>
Reference in XML
XML Ref
<block type="cms/block" name="**REFERENCED IN phtml**">
<action method="setBlockId"><block_id>**STATIC BLOCK ID**</block_id></action>
</block> phtml Ref
<?php echo $this->getChildHtml('**REFERENCED IN phtml**') ?>
click here for the original website
Subscribe to:
Comments (Atom)