I am creating a new module for my Magento project where I have a few template files which get appended to >catalog_product_view catalog_category_default checkout_cart_index and few other pages.

Currently, I have placed my module configuration file in design/fontend/base/default/layout/modulename_subfolder.xml and template file is placed at


I want to move this XML and phtml files to local/modulename/subfolder

I have tried creating the same folder structure in my module folder but it didn't work


<layout version="0.1.0">
    <reference name="content">
      <block type="core/template" name="modulename_subfolder_product_view_block" template="modulename/subfolder/my_catalog_product_view.phtml" />

1 Answer 1


You can't.

In Magento 1, module code (Models, Blocks, configuration etc) goes in app/code/local/ or app/code/community, frontend template files go in app/design/frontend/base/default/template and frontend layout files go in app/design/frontend/base/default/layout.

Yes, this means modules are not self-contained and end up scattered through the Magento filesystem. It's one of the major shortcomings of Magento 1 and was thankfully rectified in Magento 2. There are workarounds including modman which is used extensively by extension developers, but they are only workarounds and don't fix the situation.

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.