Custom top level category landing page in magento

Custom top level category landing page in magento

August 9, 2026 · Illustrated author avatarBy Stefan Bogdanescu
Custom top level category landing page in magento

Customizing Top Level Category Landing Pages in Magento

In this post, we’ll walk you through the process of creating custom landing pages for your top level categories in Magento. Let’s assume that you have set up a basic category structure like the one described:

Electronics

  • DVD Players
  • MP3 Players
  • Computers

Furniture

  • 3-Piece Sets
  • Armchairs
  • Tables
  • Sofabeds

Your goal is to display a custom grid of subcategories along with their associated thumbnail images for these top level categories, instead of the default product list.

Step 1: Create a Custom Template

First, you need to create a new template file that will serve as the base for your custom layout. You can do this in your local development environment or directly on your server if you have access.

Create a new folder called templates inside your theme directory (usually located at app/design/frontend/{vendor}/{theme}). Inside this folder, create another folder named after your top level category, e.g., electronics.

Within the electronics folder, create two files: list.phtml and topmenu_item.phtml. These will be used to display your custom subcategory grid.

Step 2: Define the Custom Layout Update XML

Next, you need to define a layout update XML file that maps your top level category to the new template. Create a new folder called layouts inside your theme directory if it doesn’t exist.

Create an XML file named after your top level category, e.g., electronics.xml. Inside this file, add the following code:

<?xml version="1.0"?>

<layout>
  <catalog_category_view id="electronics">
    <update handle="page_3columns_left" />
    <reference name="content">
      <block type="core/template" template="electronics/list.phtml" before="-"/>
    </reference>
    <reference name="left">
      <remove name="category.products"/>
    </reference>
  </catalog_category_view>
</layout>

This layout update file maps the catalog_category_view action for your top level category to a custom layout called electronics. It removes the default product listing block and adds your custom list.phtml template in its place.

Step 3: Customize Your Templates

Now it’s time to customize your templates. Open the topmenu_item.phtml file you created earlier.

In this file, you can use Magento’s category API to fetch all subcategories for a given top level category and display them in a custom grid format with their thumbnail images:

<?php
$category = Mage::registry('current_category');
$subCategories = $category->getChildrenCategories();

foreach ($subCategories as $subCategory) {
    echo '<div class="sub-category">';
        echo '<a href="' . $subCategory->getUrl() . '">' . $subCategory->getName() . '</a>';
        if($subCategory->getThumbnail()) {
            echo '<img src="' . Mage::helper('catalog/image')->init($subCategory, 'thumbnail')->resize(200)->__toString() . '" />';
        }
    echo '</div>';
}
?>

This code retrieves the current category using Magento’s registry and fetches all its subcategories. It then loops through each subcategory, displays a link to it, and if available, outputs an image using Magento’s thumbnail helper.

Step 4: Assign the Custom Layout to Your Top Level Category

The final step is to assign your custom layout to your top level category in Magento’s admin area:

  1. Log in to your Magento backend.
  2. Navigate to “Catalog” > “Categories”.
  3. Find and select your top level category (e.g., Electronics).
  4. In the left sidebar, under “Custom Design”, enable the “Apply Custom Layout” option.
  5. Select the layout you created earlier from the dropdown menu (e.g., electronics.xml).
  6. Click “Save Category”.

Conclusion

With these steps, you should now have a custom landing page for your top level categories in Magento. This page will display a grid of subcategories with their thumbnail images instead of the default product list.

Remember to replace “Electronics” and “electronics” with your actual category name throughout this guide. Also, ensure that you have correct permissions on your server to create and modify files in your theme directory.

If you’re looking for more advanced customizations or need help with other aspects of Magento development, don’t hesitate to visit Laravel Company for expert guidance and services.

Catalog Database Themes Admin

Our network