Filtering a Category by Page Layout in Magento


Recently I needed to output categories on the homepage in magento, all these categories had a custom page layout so I thought I may as well filter by that rather than creating a custom category attribute. Here is I how I did that.

public function getCategories() {
$categories = Mage::getModel('catalog/category')->getCollection()
->addAttributeToFilter('page_layout', 'custom_layout')
return $categories;

Comments are closed.