0

I am trying to display top banner on each category page dynamically. This banner will span whole container. I am using 2columns-left layout. So banner will have 1column layout and list page content will have 2columns-left layout.

I tried following -

<catalog_category_default translate="label">
        <label>Catalog Category (Non-Anchor)</label>
        <reference name="category.banner.info">
              <block type="cms/block" name="mystaticblock" >
        <action method="setBlockId"><block_id>6</block_id></action>
        </block>
        </reference>
        <reference name="left">
            <block type="catalog/navigation" name="catalog.leftnav" after="currency" template="catalog/navigation/left.phtml"/>
        </reference>
        <reference name="content"> ... 

on Block 6 i would call phtml file and show banner dynamically. But i dont think this method will show 1 column layout for banner.

What would be the optimum way to add the banner on product list page?

  • Can you tell us what's happening? I don't think your block will be displayed anyway, you need to have it inside the <reference name="left"> node AFAIK. – Julien Lachal Dec 2 '16 at 10:37
  • Yes, its not displaying. what would be other solution? – HungryDB Dec 2 '16 at 10:43
  • 1
    You have to create a new layout refrence and call to it as per your need – Suresh Chikani Dec 2 '16 at 18:25
  • 1
    Refer this tutorial inchoo.net/magento/custom-reference-structural-block – Gopal Patel Dec 4 '16 at 14:58

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.