Is it possible to define Magento layout updates on a per-store basis

Is it possible to define Magento layout updates on a per-store basis

July 28, 2026 · Illustrated author avatarBy Stefan Bogdanescu
Is it possible to define Magento layout updates on a per-store basis

Defining Magento Layout Updates on a Per-Store Basis

In a multi-site Magento installation, it’s common to have layout requirements that differ between stores or websites. For instance, you might want to remove specific blocks or links from the customer navigation in certain areas of your application.

Let’s address how to define layout overrides specifically for one website or store in a multi-store setup.

Understanding Layout XML Configuration

Magento uses XML files to configure its layout structure and behavior. These files are typically found under app/design/frontend/<package>/<theme>/layout. The main layout file is local.xml.

You can create additional XML files here to define custom layouts or override existing ones. For a specific store, you would place your XML in the appropriate theme folder for that store.

Defining Layout Overrides for a Specific Store

To remove the “My Downloads” link from the customer navigation block for one of your websites, follow these steps:

  1. Create the required PHP file:

Navigate to app/code/local/Mage/Customer/Block/Account/Navigation.php. Add a new method called removeLink() that is not present in the core code.

public function removeLink()
{
    // Custom logic to remove the link
}
  1. Update your local.xml file:

In your local.xml file, you can define an action for the customer_account_navigation block to call this new method when needed.

Here’s a snippet that removes the “My Downloads” link from the navigation:

<layout>
    <default>
        <!--...-->
    </default>
    <customer_account>
        <reference name="customer_account_navigation">
            <action method="removeLink" translate="label" module="downloadable">
                <name>downloadable_products</name>
            </action>
        </reference>
    </customer_account>
</layout>
  1. Targeting a Specific Store

To target a specific store, you need to understand how Magento handles layout files for multiple stores.

By default, Magento uses the local.xml file across all stores since it’s in the base theme directory (base/default/layout). To make changes specific to one store, you should create an equivalent XML file in the theme folder of that store.

For example, if your second website is using the mm theme:

  • Navigate to app/design/frontend/base/mm/layout.
  • Create a new XML file with the same content as above.
  • Ensure this file has the correct path structure (<package>/<theme> directory).

Conclusion

Defining layout updates on a per-store basis in Magento requires a combination of custom PHP code and targeted XML configuration.

By understanding how Magento handles layout files for multiple stores, you can create specific overrides that apply only to the desired website or store. This approach ensures that changes are limited in scope, maintaining the desired behavior across your entire setup.

Remember, when making changes like these, always test thoroughly and consider performance implications. For more advanced customization techniques, check out our guide on Magento 2 Customization Best Practices.

Happy coding!

Themes Configuration Customers

Our network