SwissUpLabs Logo

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>
Widget code
{{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>
Widget code
{{block type="easybanner/placeholder" placeholder_name="right-top"}}
Php code
<?php
echo $this->getLayout()
    ->createBlock('easybanner/placeholder')
    ->setPlaceholderName('right-top')
    ->toHtml();
?>
Edit this Page