Home » Magento2 June 2014

Magento: Show CMS Static Block on only one specified Category page

Sometimes we might need to show a single static block in one or few specified categories only, rather than showing the static block on all pages.

The layout XML code below helps to achieve the above requirement. It will show the static block ‘my-sidebar-1′ on right sidebar of category with id ’10’. Similarly, static block ‘my-sidebar-2′ is displayed on the category page with id ’12’.

Hope this helps. Thanks.


Get New Post by Email

Find me on

FacebookTwitterGoogle+LinkedInRSS Feed
  • Santiago Yepes T.

    Hello, before I begin I want congratulate you for the great blog.

    I have a question, I don’t know if you can answer me. How do I know the category in category page with PHP?, How do I know the subcategories in category page with PHP?

  • evollove

    This is a very helpful blog for Magento development. Thank you for this great tutorial. If it’s possible, can you teach me how to do this for CMS pages?
    I want to display a static block on the Breadcrumbs area but only for 3 CMS pages.
    It would be too much of a hassle to remove the name of the block on every layout update on the rest of the pages, so I’m asking if it would be possible to just show the block on those 3 pages via local.xml?

  • manoj

    Haloo, this is very helpful to me, but try to implementing this in my web site, but i can not find the layout XML files