I'm trying to rewrite Mage_Adminhtml_Cms_Wysiwyg_ImagesController to override its indexAction(). I seem to be able to rewrite it successfully as the request is being routed to it, but I've been unable to load layout in the action.


<?xml version="1.0"?>
              <Mynamespace_Mymodule before="Mage_Adminhtml">Mynamespace_Mymodule_Adminhtml</Mynamespace_Mymodule>

mymodule.xml (layout file):

<?xml version="1.0"?>
<layout version="0.1.0">
        <update handle="adminhtml_cms_wysiwyg_images_index" />
        <reference name="content">
            <block name="mynamespace_mymodule.content" 

The controller is instantiated but the block class isn't.

Calling $this->getLayout()->getUpdate()->getHandles() in the controller action results in an empty array; it doesn't seem to have any handles.

Why might this be the case and what should I do to get the handles loaded?

1 Answer 1


Based on the layout XML you shared, the problem is with the handle:


Should be named


Generated layout handles are not concerned with the namespace and module parts. When you call $this->loadLayout() in a controller action, you will trigger this code:

# File: app/code/core/Mage/Core/Controller/Varien/Action.php
public function loadLayout($handles=null, $generateBlocks=true, $generateXml=true)

    // add default layout handles for this action



Where addActionLayoutHandles will add a handle via getFullActionName method in the same file:

public function getFullActionName($delimiter='_')
    return $this->getRequest()->getRequestedRouteName().$delimiter.

So, when you attempt to dump the handles, expect that the above type of handle would be there. You said you're getting nothing, or an empty array. Have you actually loaded the layout ($this->loadLayout()) before inspecting the handles?

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.