For instance I have a module My/Module (my_module) with a controller RenderController.php which has an action layoutAction. Is there a way that I can set a template for every action within the RenderController controller without having to do it for each individual "page" using layout xml.

I essentially want something like this:

        <reference name="root">
            <action method="setTemplate"><template>page/1column.phtml</template></action>

but I don't want that template to be assigned for EVERY page in my theme, but only for those within my module, or even the specific controller (RenderController.php) within that module.

2 Answers 2


If you want to change the template of the root reference, you can try with something like :

public function yourSpecialAction() {

    // Do your process

You could look to add a custom layout handle in your controller then set the template in your layout xml file. For example in your controller in your action method look to add something like:


Then inside for your layout xml file you can do the following:

    <reference name="root">
        <action method="setTemplate">

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.