3

This is something I did not understand and could not find satisfying answers for.

  1. What ist the difference between catalog_category_default and catalog_category_layered in catalog.xml?
  2. When is catalog_category_defaultused? Does it have to be enabled somewhere?

All I've seen rendered is catalog_category_layered with the layered navigation.

3 Answers 3

5

Basically if you activate "Is Anchor" under Category Design tab, you among other things also activate Layered Navigation. Layered Navigation means that instead of just displaying catalog list Magento also displays Filters (Prices, Categories, Dropdown Attributes and so on). Since different modes produce significantly different output there're two different page layouts.

catalog_category_default means no filters. catalog_category_layered means that there are filters as well.

1
  • great explanation!
    – localhost
    Commented Sep 2, 2016 at 8:23
1

So the layout handles for the category view page are loaded in Mage_Catalog_CategoryController::viewAction().

Beside all the other layouts (default, catalog_category_view, CATEGORY_{category id here}), one of the the 2 you mentioned are added.

This is the line that adds it.

$update->addHandle($category->getLayoutUpdateHandle());

If you take a look at the method Mage_Catalog_Model_Category::getLayoutUpdateHandle() you will see what layout handle is applied.

public function getLayoutUpdateHandle()
{
    $layout = 'catalog_category_';
    if ($this->getIsAnchor()) {
        $layout .= 'layered';
    }
    else {
        $layout .= 'default';
    }
    return $layout;
}

This means that if the category has the flag is_anchor set to yes then the catalog_category_layered handle is loaded. Otherwise catalog_category_default is loaded

1
  • in my case i checked the root category, category and sub category for is anchor filed and are well set to yes so in my catogory page, i have well the layered navigation But the layout handle is catalog-category-view and not catalog-category-layered like you explane !
    – PЯINCƎ
    Commented Jun 14, 2017 at 1:04
0

The main difference between catalog_category_default and catalog_category_layered ,when a category is loaded catalog_category_default layout it will calling Layered naviation i,e Filters attributes and categories of current Product Collection, and catalog_category_layered will show its opposite.

This setting is depending on is_anchor field of that current Category,if is_anchor is active then call catalog_category_layered layout else call catalog_category_default

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.