Different template for different categories in Magento

Different template for different categories in Magento

August 28, 2026 · Illustrated author avatarBy Stefan Bogdanescu
Different template for different categories in Magento

Customizing Category Layouts in Magento

In Magento, you can apply different layout designs to various categories by utilizing category-specific layouts and themes. This allows you to create unique visual experiences for your customers as they navigate through your store’s offerings.

To achieve this, let’s explore how to set up a distinct layout for the ‘Artist’ category while keeping other categories in their default design.

Step 1: Create a Custom Layout Update XML File

Firstly, we need to create an XML file that defines our custom layout rules. For instance, if you want to use a file named artist_category.xml, ensure it’s placed inside the /app/design/frontend/package/theme/layout directory.

<!-- app/design/frontend/package/theme/layout/artist_category.xml -->
<layout version="1.0">
    <catalog_category_view id="category_artist" template="page/1column.phtml">
        <update handle="catalog_category_layered_navigation"/>
        <reference name="head">
            <title_replace><![CDATA[Artist Category]]</title_replace>
        </reference>
        <reference name="content">
            <!-- Add your custom content here -->
        </reference>
    </catalog_category_view>
</layout>

In this example, we’ve defined a new layout handle called category_artist. We’re using the default 1-column page template and adding some basic modifications like changing the title tag.

Step 2: Assigning the Custom Layout to the ‘Artist’ Category

Next, you need to assign our newly created layout to the ‘Artist’ category. You can do this directly in the Magento admin panel:

  1. Log into your Magento backend.
  2. Navigate to Catalog > Categories.
  3. Find and click on the ‘Artist’ category.
  4. In the ‘Page Layout’ section, select ‘Custom design’.
  5. Choose the layout file you created (e.g., artist_category.xml).
  6. Click ‘Save Category’.

Step 3: Customizing the Layout Content

Now that we have a dedicated layout for our ‘Artist’ category, you can start customizing its content. You may want to add specific blocks or modify existing ones.

For example, if you wish to add a new block containing artist-specific information:

<!-- In your /app/design/frontend/package/theme/layout/artist_category.xml -->

<reference name="content">
    <block type="core/text_list" name="my_artist_info">
        <action method="addText"><text>Welcome to the Artist category!</text></action>
    </block>
</reference>

This will add a simple welcome message below your existing content.

Step 4: Extending This Approach to Other Categories

To apply different layouts and designs to other categories, follow these steps:

  1. Create new XML layout files (e.g., designer_category.xml, photographer_category.xml).
  2. Define the desired layout handles and templates.
  3. Assign each category its respective layout in the Magento admin panel.

Conclusion

By leveraging Magento’s custom layout capabilities, you can create unique visual experiences for your customers based on their interests or product categories. This approach allows you to maintain a cohesive brand identity while offering tailored navigation options.

Remember that the key lies in creating specific XML files for each desired category and assigning them through the Magento admin interface. As you expand your store, you can easily apply this method to other categories as well.

For more advanced customization techniques and best practices, be sure to explore the comprehensive resources available at Laravel Company. Happy coding!

Catalog Themes Customers

Our network