Display Products on Home Page with Pagination in Magento

Display Products on Home Page with Pagination in Magento

August 24, 2026 · Illustrated author avatarBy Stefan Bogdanescu
Display Products on Home Page with Pagination in Magento

Displaying Products on Home Page with Pagination in Magento

As a new Magento developer, you might face challenges when trying to display a large number of products on your CMS page with pagination. In this post, we’ll explore how to overcome this common issue.

The Problem: Limited Product Display

By default, Magento limits the number of products displayed per page to 20 records. This can be problematic if you have hundreds or thousands of products in your catalog that you want to showcase on your homepage.

Attempting to use the code snippet provided by the user won’t solve this issue directly because it only sets a specific category ID for the product list block, which doesn’t handle pagination or the number of records displayed per page.

Default Paging Mechanisms in Magento

Magento comes with built-in paging mechanisms that can be easily integrated into your CMS pages. The key is to use the correct blocks and templates provided by the core system.

Step 1: Use the Correct Block Type

Instead of using catalog/product_list block, you should use the catalog/product_list_toolbar block for pagination purposes. This block extends the functionality of a simple product list and includes navigation links for navigating through the products.

Your updated layout XML code should look like this:

<reference name="content">
    <block type="catalog/product_list_toolbar" name="product_list_toolbar">
        <action method="setCategoryId"><category_id>2</category_id></action>
        <block type="catalog/product_list" template="catalog/product/list.phtml">
            <action method="setColumnCount"><count>4</count></action>
        </block>
    </block>
</reference>

In this example, we are using the catalog/product_list_toolbar block and nesting it with the catalog/product_list block inside. We have added an action to set the category ID to 2.

Step 2: Set the Number of Columns

By default, Magento displays products in a single column layout. If you want to display multiple columns, you can specify the number of columns using the setColumnCount action within the nested product list block.

In our example, we have set the column count to 4, which means each page will show four products side by side.

Step 3: Test Your Configuration

After updating your layout XML file, make sure to refresh the cache and test your CMS page. You should now see pagination links at the bottom of the product list, allowing users to navigate through multiple pages of products.

Conclusion

Displaying a large number of products on your Magento homepage with pagination is straightforward if you leverage the built-in blocks provided by the core system.

Remember to use the catalog/product_list_toolbar block for pagination and customize the number of columns using the setColumnCount action within the nested product list block. This approach ensures that your users have a seamless experience browsing through your extensive catalog.

At Laravel Company, we provide comprehensive guides on Magento development, including best practices for handling large product lists and pagination effectively. Explore our blog to learn more about Magento 2 development and its advanced features.

Catalog Themes Errors

Our network