Magento - Add CMS Block to One Page

Magento - Add CMS Block to One Page

July 1, 2026 · Illustrated author avatarBy Stefan Bogdanescu
Magento - Add CMS Block to One Page

How to Add a CMS Static Block to Magento Blog Pages Only

In this post, we’ll guide you through adding a CMS static block specifically to your Magento blog pages while keeping it hidden from other parts of your store.

Understanding the Problem

The issue lies in how layout XML files are structured and applied in Magento. When you add a block directly under <reference name="left">, it’s added to the main layout, which means it appears on every page.

To restrict the block to blog pages only, we need to use the appropriate layout handles defined for those specific pages.

Identifying the Relevant Layout Handles

In your provided XML file, you have already defined layout handles for different blog pages:

<blog_index_index>
  <reference name="content">
    <block type="blog/blog" name="blog" template="aw_blog/blog.phtml"/>
  </reference>
</blog_index_index>

<blog_post_view>
  <reference name="content">
    <block type="blog/post" name="post" template="aw_blog/post.phtml">
      <block type="socialbookmarking/bookmarks" name="bookmarks" template="bookmarks/bookmarks.phtml"/>
    </block>
  </reference>
</blog_post_view>

<blog_cat_view>
  <reference name="content">
    <block type="blog/cat" name="cat" template="aw_blog/cat.phtml" />
  </reference>
</blog_cat_view>

Each handle is unique to a specific blog page view—index, post view, and category view.

Adding the CMS Block to the Correct Handle

To add your brand_list block to these handles, you need to include it inside each relevant layout block:

<layout version="0.1.0">
  <!-- ... existing code ... -->
    <blog_index_index>
        <reference name="content">
            <block type="blog/blog" name="blog" template="aw_blog/blog.phtml"/>
            <block type="cms/block" name="brand_list">
                <action method="setBlockId"><block_id>brand_list</block_id></action>
            </block>
        </reference>
    </blog_index_index>

    <blog_post_view>
        <reference name="content">
            <block type="blog/post" name="post" template="aw_blog/post.phtml">
                <block type="socialbookmarking/bookmarks" name="bookmarks" template="bookmarks/bookmarks.phtml"/>
                <block type="cms/block" name="brand_list">
                    <action method="setBlockId"><block_id>brand_list</block_id></action>
                </block>
            </block>
        </reference>
    </blog_post_view>

    <blog_cat_view>
        <!-- ... existing code ... -->
    </blog_cat_view>

  <!-- ... rest of your layout XML file ... -->
</layout>

Ensure you add the brand_list block inside each <reference name="content"> section and before any other blocks under the corresponding handle.

Conclusion

By strategically placing your CMS static block within the specific layout handles for blog pages, you can ensure it only appears on those pages while being hidden from the rest of your store.

Remember to clear Magento’s cache after making these changes:

  1. Log in to your Magento admin panel.
  2. Navigate to System > Cache Management.
  3. Select all checkboxes under “Cache Type”.
  4. Click on “Flush Magento Cache”.

Your blog pages should now display the brand_list block correctly without affecting other parts of your website.

For more advanced customizations and best practices in Magento, visit our Magento Development Hub at Laravel Company.

Catalog API Themes Errors

Our network