Home >
Magento 1.x >
Extensions >
Easybanners >
Use cases >
Use banner and placeholder programmatically
Use banner and placeholder programmatically
Contents
Banners
Xml code
<reference name="content">
<block type="easybanner/banner" name="unique_banner_name">
<action method="setBannerName"><name>test</name></action>
</block>
</reference>
{{block type="easybanner/banner" banner_name="test"}}
Php code
<?php
echo $this->getLayout()
->createBlock('easybanner/banner')
->setBannerName('test')
->toHtml();
?>
Placeholders
Xml code
<reference name="content">
<block type="easybanner/placeholder" name="unique_placeholder_name">
<action method="setPlaceholderName"><name>right-top</name></action>
</block>
</reference>
{{block type="easybanner/placeholder" placeholder_name="right-top"}}
Php code
<?php
echo $this->getLayout()
->createBlock('easybanner/placeholder')
->setPlaceholderName('right-top')
->toHtml();
?>