List of new product on homepage in Magento

List of new product on homepage in Magento

July 21, 2026 · Illustrated author avatarBy Stefan Bogdanescu
List of new product on homepage in Magento

Displaying New Products on Magento Homepage

Welcome to your new Magento store! In this tutorial, I’ll guide you through the process of displaying a list of new products on your homepage using XML layout updates and .phtml templates.

Understanding Magento’s Layout System

Magento uses an event-driven architecture for handling requests. The layout system is responsible for merging and rendering the final HTML output sent to the browser.

Updating Your Theme’s Layout XML

To begin, navigate to the app/design/frontend/<your_theme>/layout folder in your Magento installation. Here, you’ll find various XML files that define how content should be laid out on different pages of your store.

For displaying new products on the homepage, we need to update or create a new layout file for the catalog index page (homepage).

  1. Copy the catalogindex.xml file from this repository: https://github.com/laravelcompany/magento-layout-examples/blob/main/catalogindex.xml

  2. Place this copied file in your theme folder: app/design/frontend/<your_theme>/layout/

The layout XML should look something like this:

<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/layout_generic.xsd">
    <update handle="catalog_index_index"/>
    <referenceContainer name="content" htmlTag="div" htmlClass="product-grid home-page-grid" after="-">
        <block class="Magento\Catalog\Block\Product\NewProducts" template="Magento_Catalog::product/new/grid.phtml" before="-"  name="homepage.new.products"/>
    </referenceContainer>
</layout>

This XML adds a new container for the product grid and defines a block using the Magento\Catalog\Block\Product\NewProducts class. The content is rendered using the product/new/grid.phtml template.

Customizing the Product Grid Template

Next, let’s modify the grid.phtml file to display only product images without titles or add-to-cart buttons.

Navigate to your theme folder: app/design/frontend/<your_theme>/Magento_Catalog/templates/product/new

Open or create a new template file called grid.phtml.

<div class="products-grid products-grid--homepage">
    <?php foreach ($block->getProductList() as $_item): ?>
        <div class="product-item" itemscope itemtype="http://schema.org/Product">
            <div class="item-image">
                <a href="<?php echo $this->helper('Magento\Catalog\Helper\Data')->getProductUrl($_item) ?>" class="product photo no-hvr" itemprop="image">
                    <?php $image = $block->getImage($_item, 'product_page_image_small'); ?>
                    <img src="<?php echo $image->getBaseFile() ?>" width="<?php echo $image->getWidth(); ?>" height="<?php echo $image->getHeight(); ?>" alt="<?php echo $this->escapeHtml($image->getLabel()); ?>">
                </a>
            </div>
        </div>
    <?php endforeach; ?>
</div>

This template displays a grid of product images using the Magento\Catalog\Helper\Data helper to generate URLs. It uses the product_page_image_small image for each product.

Conclusion

With these changes, you should now see a list of new products displayed on your Magento homepage with only their images visible. Remember that themes have a hierarchy in Magento, so if you want these changes to persist across updates, apply them in your custom theme rather than the default theme.

For more detailed information about layout updates and template customization, I recommend checking out Laravel Company’s Magento Developer Guide.

That’s it! You’re well on your way to creating a compelling home page experience for your customers. Don’t hesitate to customize further to match your brand identity.

Happy coding!

Catalog Indexing Themes Admin

Our network