Magento: Using different footers for different page layouts

Magento: Using different footers for different page layouts

September 25, 2026 · Illustrated author avatarBy Stefan Bogdanescu
Magento: Using different footers for different page layouts

Solving Layout Issues: Creating Different Footers for Magento Pages

Hello developers! I understand your frustration when layout issues don’t work as expected, especially when dealing with Magento’s complex architecture.

The Current Setup: Two Page Layouts and XML Configuration

You’ve set up two page layouts - one for the homepage (footer_home) and another for all other pages (footer_alt). You’re using:

<?php echo $this->getChildHtml('footer_home') ?>

for the homepage layout, and

<?php echo $this->getChildHtml('footer_alt') ?>

for other page layouts.

In your XML configuration, you’ve correctly defined both footer blocks with their respective templates:

<block type="page/html_footer" name="footer_alt"... />
<block type="page/html_footer" name="footer_home"... />

However, there seems to be a misunderstanding in how Magento handles these layouts.

Understanding the Problem: Magento’s Layout Process

The issue lies in the way Magento processes and applies layouts. When you declare multiple footer blocks in your layout XML file:

<block type="page/html_footer" name="footer_alt"... />
<block type="page/html_footer" name="footer_home"... />

Magento doesn’t inherently know which one to use for a specific page. Instead, it interprets the XML linearly and applies the last declared block (footer_home) to all pages.

The Solution: Setting Layout Handles in the CMS

To fix this issue, you need to set layout handles specifically for each CMS page. This tells Magento exactly which layout (and therefore footer) to apply for that particular page.

Update your CMS page settings:

  1. Go to Content > Pages.
  2. Click “Edit” on the homepage CMS page.
  3. Scroll down and find the “Design” tab.
  4. In the “Layout Update XML via Admin” field, add the following:
<reference name="root">
    <action method="setTemplate">
        <selector>page/html/footer_home.phtml</selector>
    </action>
</reference>
  1. Save your changes.

This tells Magento to use the footer_home footer for this specific CMS page (the homepage in this case).

Conclusion: Clear Communication and Specific Layout Assignments

Remember, when working with Magento layouts, you must communicate very clearly which layout should be used for each page or block. Don’t rely on the XML file alone; use the CMS page settings to assign a specific layout handle.

With this approach, your homepage will now display the footer_home footer, while all other pages will default to the footer_alt footer as expected.

I recommend exploring our Laravel Company blog for more in-depth tutorials and best practices on Magento development.

Themes Configuration Errors

Our network