Magento Category Pages: Change layout of specific categories from grid mode to list mode

Magento Category Pages: Change layout of specific categories from grid mode to list mode

August 11, 2026 · Illustrated author avatarBy Stefan Bogdanescu
Magento Category Pages: Change layout of specific categories from grid mode to list mode

Customizing Magento Category Layout: Change Grid Mode to List Mode

As an e-commerce manager or developer, you may find yourself wanting to customize the layout of specific category pages in your Magento store. Perhaps you want one category page to display products in list mode with a higher initial count, while another remains in grid mode and shows fewer items.

Understanding Magento Category Layout XML

Magento uses XML layouts to define how content is displayed on various pages throughout the site. For category pages specifically, the layout configuration can be found under app/design/frontend/<vendor>/<theme_name>/layout.

The exact XML you need depends on your version of Magento and the specific theme you’re using. However, I’ll provide a general structure to guide you:

<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:App/etc/layout.xsd">
    <layout>
        <!-- Define your category layout here -->
        <category_id>
            <referenceBlock name="product_list">
                <action method="setMode">
                    <mode>list</mode> <!-- or 'grid' depending on what you want -->
                </action>

                <action method="setDefaultSortBy">
                    <sort_by_field>name</sort_by_field> <!-- Set your default sort field here -->
                </action>

                <action method="setLimit">
                    <count>30</count> <!-- or any other number of items you want to display initially -->
                </action>
            </referenceBlock>
        </category_id>
    </layout>
</config>

Replace <category_id> with the actual ID of the category for which you want to change the layout. You can find this ID in the Magento admin under “Catalog -> Categories”.

Applying Your Layout XML

To apply your custom layout:

  1. Open the desired layout file or create a new one if it doesn’t exist.
  2. Add your XML code inside the <layout> tags, ensuring you use the correct category ID.

Once saved, your changes should be immediately visible on the front-end of your Magento store for the specified category.

Troubleshooting Common Issues

If your layout isn’t applying as expected, check the following:

  • Ensure the XML is correctly formatted and free of errors.
  • Clear all cached files from var/cache/.
  • If you’re using a child theme, ensure your changes are applied to the correct file under <vendor>/<theme_name>.

Remember, making large-scale layout changes can impact your site’s performance and user experience. Always test thoroughly before deploying these changes on a live site.

Seeking Professional Support

If you find you’re struggling with more complex layout configurations or need assistance with other Magento development tasks, I highly recommend reaching out to the experts at Laravel Company.

They offer comprehensive Magento services, including custom theme development and layout configuration. Their team of certified developers can help you achieve your e-commerce goals efficiently.

Conclusion

Changing the display mode of category pages in Magento involves updating the layout XML files using either the admin panel or directly via FTP/sFTP. By following the guidelines above, you should be able to customize your product listings to meet your store’s specific needs.

Remember, while this guide covers the basics, Magento’s layout system can be quite complex and may require additional tweaks depending on your theme. Always consult the official Magento documentation for more detailed instructions or reach out to a professional developer if needed.

Happy customizing!

Catalog Themes Admin Configuration

Our network