Grid mode on home page - Magento

Grid mode on home page - Magento

October 16, 2026 · Illustrated author avatarBy Stefan Bogdanescu
Grid mode on home page - Magento

Changing Product Display Mode on Magento Home Page

In Magento, the home page product display mode is controlled by your theme’s configuration and layout XML files. Even though you’ve configured grid mode in the backend admin panel, it might not apply to the home page if your theme has been specifically designed with a different default.

Understanding the Issue

The issue arises because the home page layout is often defined separately from the regular category layouts. When you specify catalog/product_list block type, Magento defaults to list mode unless otherwise configured in the template file or XML layout update for that specific block instance.

In your case, the block configuration inside the CMS page content looks correct:

{{block type="catalog/product_list" category_id="3" num_products="6" template="catalog/random.phtml"}}

However, the random.phtml template file is likely using list mode by default or not specifying a mode at all.

Solving the Problem

To resolve this, you need to override the layout XML for the home page product listing and specify grid mode explicitly. Here’s how:

  1. Create a local.xml file in your theme directory:

    Navigate to app/design/frontend/{Your_Theme}/{Your_Version}/layout and create a new file named local.xml. If the folder doesn’t exist, you’ll need to create it.

  2. Add the following code inside tag:

<default>
    <reference name="content">
        <block type="catalog/product_list" name="home_category_products" template="catalog/product/list.phtml">
            <action method="setCategoryId"><category_id>3</category_id></action>
            <action method="setMode"><mode>grid</mode></action>
            <action method="setLimit"><limit>6</limit></action>
        </block>
    </reference>
</default>
  1. Update the CMS block:

    Open your home page CMS content again and update the block call to reference the new block name:

{{block type="core/template" template="catalog/product/list.phtml"}}

<!-- Or if you want to keep the existing template: -->
<!-- {{block type="catalog/product_list" template="catalog/random.phtml"}} -->

Explanation of Changes

In the local.xml file, we’re doing a few things:

  • We’re creating a new block named home_category_products.
  • We’re setting the category ID to 3.
  • Most importantly, we’re explicitly setting the mode to grid.
  • Finally, we’re limiting the number of products displayed.

The key is that this layout update applies only when the home page (default layout) is rendered. It doesn’t interfere with other pages like catalog categories which might have different settings.

Verifying the Changes

Save your updates and refresh the home page cache:

php bin/magento cache:flush

Or if you’re running Magento 2.4.x or later, use:

php bin/magento cache:clean

Now, check your home page again. The products should now be displayed in grid mode as expected.

Remember that theme customization is a powerful feature but it requires careful handling to avoid conflicts with core functionality. Always backup important files before making changes and test thoroughly.

For more detailed guides on Magento theme development, I recommend checking out the official documentation or resources like Laravel Company’s Magento Tutorials.

Happy coding! Let me know if you have any other questions.

Catalog Themes Admin Configuration

Our network