I have created a custom module create/routing, with a controller RoutingController.php which has several actions index, upload, instagram and I would like to update the template for all of these actions to a custom file page/routing.phtml within my local.xml

For the customer/account module I would write:

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

However following the same method for my own module:

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

Does not change the template for any action.

I have also tried <create_routing_default /> and I know the setTemplate method works as if I add it directly to an action i.e. <create_routing_index /> the template is correctly updated.

I must be missing something fundamental here, do I need to declare something within my module to enable this functionality?

1 Answer 1


You are nearly there.

By default they will not look in create_routing. You still need to add something to each action handle like so;

    <update handle="create_routing" />

This will inherit the xml declared in create_routing. You will need to do the same for each action.

The alternative is to programatically add another handle (create_routing) to the layout in an abstract function called by each of the controller actions. I prefer the xml route though.

  • Thanks @Smartie this works and is a little neater than my example, do you have any more info on that abstract function you mentioned, I have had a look through the AccountController for customer/account but cant see anything at a glance? Commented Sep 15, 2015 at 10:47
  • If you look through app/design/frontend/base/default/layout/customer.xml you will also see Magento using the xml way as above with <update handle="customer_account"/>
    – Smartie
    Commented Sep 15, 2015 at 11:11

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.