Search code examples
xmlmagentomodel-view-controllermagento-1.7magento-1.8

Magento custom layout works only locally


Running a Magento CE 1.8 site and needed to set up a very basic CMS page using a custom page layout, based off the 1column.phtml layout. I created the layout and am able to select it in the admin locally but upon pushing my changes to the remote, the custom layout is not available as an option on the remote site, only my localhost.

I've cleared the cache, removed the session and cache dirs on the remote, quadruple checked all the necessary files were added to the commit and pushed, and logged out and back in (a few times), just to make sure. Still nothing.. I can't figure it out! It's one of the simplest things in Magento and it clearly works locally but I can't find the discrepancy between local and remote. I know it's something probably way easy but I'm stumped. Tried a few answers I found but nothing seems to work - though My custom CMS Layout Template in Magento is not loaded would do it but no dice.

Code is below, if it helps:

/app/code/local/styleguide/etc/config.xml:

<?xml version="1.0"?>
<config>
  <modules>
    <styleguide>
      <version>0.1.0</version>
    </styleguide>
  </modules>
  <global>
    <page>
      <layouts>
        <style_guide translate="label">
          <label>style_guide</label>
          <template>page/styleguide.phtml</template>
          <layout_handle>style_guide</layout_handle>
        </style_guide>
        <!-- add more layouts here -->
      </layouts>
    </page>
  </global>
</config>

/app/design/frontend/MY_THEME/default/template/page/styleguide.phtml:

<?xml version="1.0"?>
<config>
  <modules>
    <styleguide>
      <version>0.1.0</version>
    </styleguide>
  </modules>
  <global>
    <page>
      <layouts>
        <style_guide translate="label">
          <label>style_guide</label>
          <template>page/styleguide.phtml</template>
          <layout_handle>style_guide</layout_handle>
        </style_guide>
        <!-- add more layouts here -->
      </layouts>
    </page>
  </global>
</config>

/app/etc/modules/styleguide.xml:

<?xml version="1.0"?>
<config>
  <modules>
    <styleguide>
      <active>true</active>
      <codePool>local</codePool>
      <depends>
        <Mage_Page />
      </depends>
    </styleguide>
  </modules>
</config>

Solution

  • I think there is a problem in your folder structure paths..

    As mentioned /app/code/local/styleguide/etc/config.xml in the above, your Namespace path is missing.. Generally it has to be as follows: app/code/local/Namespace/Module/etc/config.xml and also your Module Name has to start with Capital letter.

    But here it is with small letter. And also your module.xml is wrong.. There no Namespace in your module.xml at app/etc/modules/Namespace_Module.xml It has to be as follows:

    <?xml version="1.0"?>
    <config>
    <modules>
        <Namespace_Home>
        <active>true</active>
        <codePool>local</codePool>
        </Namespace_Home>
    </modules>
     </config>
    

    Can you first check all these things..