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