Not very experienced with Magento layouts, so forgive me, if the question is too vague.

I have defined a layout in config.xml similar to this:

        <campaign module="page" translate="label">

But I seem not the get the <layout_handle> definition correct, have tried define a separate file, using another handle, etc. Nothing seems to work, the default layout for the page (category) is always used.

Edit: the code is in module's config.xml. I wish to use my own layout instead of the catalog_category_default

  • Where did you put this code? Did you cleared the cache? – SeStro Dec 3 '15 at 17:51
  • Config.xml. Cache not in use. – Tero Lahtinen Dec 3 '15 at 17:53
  • Do you want add new layout for CMS pages or change layout of category page? – SeStro Dec 3 '15 at 18:02
  • Change layout of category page. The layout should be selectable from the custom design / page layout drop down in admin. – Tero Lahtinen Dec 3 '15 at 18:06
  • Ok, I get it. Check config scope ('Choose Store View' select list). Maybe your changes for global scope are overriden by store scope? – SeStro Dec 3 '15 at 18:38

Layout handle, defined in Page Layout, for some reason, works only for CMS pages (Alan Storm described it here). If you want add custom handle to specified categories, you could use this code:


<?xml version="1.0" encoding="UTF-8" ?>


<?xml version="1.0" encoding="UTF-8" ?>





class SeStro_CatalogPageLayoutHandle_Model_Observer

    public function addCategoryLayoutHandle(Varien_Event_Observer $observer)
        $category = Mage::registry('current_category');

        if (!($category instanceof Mage_Catalog_Model_Category)) {

        if ($category->getLayoutHandle()) {
            $layoutHandleName = str_replace(' ', '_', $category->getLayoutHandle());
            $update = $observer->getEvent()->getLayout()->getUpdate();
            $handles = $update->getHandles();

            foreach ($handles as $handle) {
                if (trim($handle) === 'catalog_category_layered') {;



$installer = $this;

$installer->addAttribute(Mage_Catalog_Model_Category::ENTITY, 'layout_handle', array(
    'group'             => 'Custom Design',
    'input'             => 'text',
    'type'              => 'text',
    'frontend_class'    => 'validate-alphanum-with-spaces',
    'label'             => 'Layout Handle',
    'backend'           => '',
    'visible'           => true,
    'required'          => false,
    'global'            => Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_GLOBAL,



<?xml version="1.0" encoding="UTF-8" ?>
        <reference name ="content">
            <block type="core/text" name="bazinga" before="-">
                <action method="setText"><text>bazinga!</text></action>

Then go to Catalog->Manage Categories->Category->Custom Design tab, and add 'bazinga' as Layout Handle. Of course you could use another handle name and content. You could also use your module to add observer and category attribute.

  • I did not try this, but I'm sure this would work. I have been successfully been able to change the template page.I would however like to use the standard 1column.pthml and just define my own layout, but I just can't get it to work. In your example, how do I define the bazinga XML layout? – Tero Lahtinen Dec 4 '15 at 7:49
  • I eddited my answer. I hope that it solve your problem ;] – SeStro Dec 6 '15 at 13:39

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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