SwissUpLabs Logo

Banners and Placeholders Usage

First, you need to create a banner. See the Admin Interfaces section page.

Awesomebar and Lightbox banners will be shown automatically. No further actions required.

Banners, that are linked to placeholders with non-empty Parent Container field will be shown automatically too. No further actions required.

Show banner on frontend

If a banner is linked to the placeholder, scroll down to the “Show placeholder on frontend” section.

After you saved a banner you need to accomplish one of the following steps to make it visible on frontend:

Add banner to CMS Page content

Use Magento’s WYSIWYG’s Insert Widget button.

Add banner to other pages or sidebar

Use Magento’s Content > Widgets interface.

Add banner with XML or PHP code

XML

<block class="Swissup\Easybanner\Block\Banner" name="block_name_1">
    <arguments>
        <argument name="banner" xsi:type="string">BannerIdentifier</argument>
    </arguments>
</block>

PHP

<?php
echo $this->getLayout()
    ->createBlock('Swissup\Easybanner\Block\Banner')
    ->setBanner('BannerIdentifier')
    ->toHtml();
?>

Show placeholder on frontend

If you saved placeholder with empty Parent Container field, you need to accomplish one of the following steps to make it visible on frontend:

Add placeholder to CMS Page content

Use Magento’s WYSIWYG’s Insert Widget button.

Add placeholder to other pages or sidebar

Use Magento’s Content > Widgets interface.

Add placeholder with XML or PHP code

XML

<block class="Swissup\Easybanner\Block\Placeholder" name="block_name_2">
    <arguments>
        <argument name="placeholder" xsi:type="string">PlaceholderName</argument>
    </arguments>
</block>

PHP

<?php
echo $this->getLayout()
    ->createBlock('Swissup\Easybanner\Block\Placeholder')
    ->setPlaceholder('PlaceholderName')
    ->toHtml();

Next up

Edit this Page