Adding custom home page with static blocks

Adding custom home page with static blocks

October 18, 2026 · Illustrated author avatarBy Stefan Bogdanescu
Adding custom home page with static blocks

Creating a Custom Home Page with Static Blocks in Magento 1.8

As an experienced e-commerce developer working on Magento installations, I often receive questions about customizing the home page to include static blocks that cannot be edited through the CMS > Pages editor. In this post, we’ll walk through the process of creating a custom home page layout that incorporates these static blocks in a Magento 1.8 setup.

Understanding Static Blocks and Layouts

Before diving into the implementation, let’s clarify some key concepts:

Static Blocks

Static blocks are reusable pieces of content that can be inserted into various parts of your Magento store using layout XML files or directly via PHP code. Unlike CMS pages, static block content cannot be edited through the admin panel’s CMS > Pages section.

Layouts

Layouts in Magento define how different elements should be displayed on a particular page. They use XML to specify where and how blocks are rendered. By default, Magento has a generic layout for the home page (CMS Index), which is shared with all other CMS pages.

Creating Your Custom Home Page

To create a custom home page layout in Magento 1.8, follow these steps:

Step 1: Disable the Default CMS Index Layout

First, let’s disable the default CMS index layout so that it won’t be applied to our custom home page.

  1. Open your app/design/frontend/<your_package>/<your_theme>/layout/local.xml file.
  2. Add or modify the <default> node to exclude the cms_index_index handle:
<default>
    <remove name="cms_index_index" />
</default>

Step 2: Create a New Layout Update XML File

Next, we’ll create a new layout update file specifically for our custom home page.

  1. Navigate to your theme’s layout folder:

    app/design/frontend/<your_package>/<your_theme>/layout/
    
  2. Create a new file named custom_homepage.xml.

  3. Add the following content to the custom_homepage.xml file:

<?xml version="1.0"?>
<layout version="1.0">
    <default>
        <remove name="cms_index_index" />
    </default>
</layout>
  1. Save the file.

Step 3: Create Your Static Blocks

Now, let’s create the static blocks that will be used on your custom home page.

  1. Navigate to Admin > CMS > Static Blocks.

  2. Click on “Add New Block”.

  3. Enter a unique identifier for your block (e.g., custom_homepage_block).

  4. Add your desired content in the “Content” field.

  5. Set the status to “Enabled”.

  6. Save the block.

Step 4: Assign the Static Blocks to Your Custom Layout

Finally, we’ll assign the static blocks to our custom home page layout.

  1. Open your custom_homepage.xml file from step 2.

  2. Add a new <reference> node with the name of your CMS Index page (likely cms_index_index).

  3. Inside this <reference> node, add a new <block> node for each static block you created:

<default>
    <remove name="cms_index_index" />
</default>

<cms_index_index translate="label">
    <reference name="content">
        <block type="cms/block" name="custom_homepage_block" before="-">
            <action method="setBlockId"><block_id>custom_homepage_block</block_id></action>
        </block>
    </reference>
</cms_index_index>

Step 5: Update Your CMS Index Page

  1. Navigate to Admin > CMS > Pages.

  2. Find your home page (likely the one with the title “Home”).

  3. Set the layout update XML file path to /layout/custom_homepage.xml.

  4. Save the page.

Conclusion

By following these steps, you can successfully create a custom home page with static blocks that cannot be edited through the CMS > Pages editor in your Magento 1.8 installation. This approach allows for greater control over your store’s front-end content while keeping it secure from unauthorized modifications.

Remember to keep your code clean and organized by using proper layout files and following Magento’s best practices for theme development.

For more advanced customization techniques and tips on optimizing your Magento setup, check out the Magento Development Guide on our website.

Magento 1 Indexing Themes Admin

Our network