0

I added the following to /app/etc/local.xml, which works. Obviously I need these changes to survive an upgrade. Did I do this correctly?

<global> 

...

     <page>
        <layouts>
            <home module="page" translate="label">
                <label>Home</label>
                <template>page/home.phtml</template>
                <layout_handle>page_home</layout_handle>
            </home>
            <product module="page" translate="label">
                <label>Product</label>
                <template>page/product.phtml</template>
                <layout_handle>page_product</layout_handle>
            </product>
        </layouts>
     </page>
</global>
Joshua Cook
  • 12,495
  • 2
  • 35
  • 31
  • i would add it to the `app/code/local/Namespace/YourTheme/etc/config.xml` of your custom module. But as your local.xml config will not be overwritten (it keeps your mysql credentials, caching etc...) its at least safe from upgrades. – Michael Leiss Jun 22 '13 at 21:17

1 Answers1

1

No, you did not do this correctly. The app/etc/local.xml file should contain only the configuration items Magento needs to bootstrap it's environment.

The "correct" (i.e. following community standards, and therefore giving you the best chance at support in the future) is to create your own Magento module and add the custom configuration there. Beyond being the right way to do things, this also makes it easier to distribute these changes to other Magento users.

Alana Storm
  • 164,128
  • 91
  • 395
  • 599
  • I guess I am a little confused as to the nature of "layouts." Bare in mind, I am a fairly recent wordpress emigre. I am assuming that layouts pertaining to theming, whereas I equate modules with plugins. Perhaps there is no direct corollary between the two. Do I define layouts globally so that they are available to all themes? Is it possible to define layouts only for a specific theme? Ultimately, does all of this presuppose creating a custom module for any theme? Is this the best practice? Assume competence in the code. I am trying to understand the conceptual basis of magento theming. – Joshua Cook Jun 23 '13 at 00:54
  • Apparently there is this service called google that is quite helpful in answering one's own questions. Alan, Mischa, thanks for giving me the proper vocabulary to complete my google search. For those interested, the answer to the original question can be found here: [Adding CMS Layout Templates](http://goo.gl/SER5y) – Joshua Cook Jun 23 '13 at 01:01