2

I have override page Module means changes the footer pages. So that I have created Page module. but it's displaying empty page.

my code is:

magento\app\etc\modules\Page.xml

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

magento\app\code\local\Easylife\Page\etc\config.xml

<?xml version="1.0"?>
<config>
    <modules>
        <Easylife_Page>
            <version>0.1.0</version>
        </Easylife_Page>
    </modules>
    <frontend>
        <layout>
            <updates>
                <easylife_page>
                    <file>page.xml</file>
                </easylife_page>
            </updates>
        </layout>
    </frontend>
</config>

magento\app\design\frontend\easylife\default\layout\page.xml

<?xml version="1.0"?>
<layout version="0.1.0">

    <default translate="label">
        <label>All Pages</label>

        <block type="page/html_footer" name="footer" as="footer" template="page/html/footer.phtml">
            <block type="page/html_wrapper" name="bottom.container" as="bottomContainer" translate="label">
                <label>Page Footer</label>
                <action method="setElementClass"><value>bottom-container</value></action>
            </block>
            <block type="page/switch" name="store_switcher" as="store_switcher" template="page/switch/stores.phtml"/>
            <block type="page/template_links" name="footer_links" as="footer_links" />
        </block>


    </default>

</layout>

magento\app\design\frontend\easylife\default\template\page\html\footer.phtml

<div class="footer-container">
    <div class="footer">
        <address><?php echo $this->getCopyright() ?></address>
        <p class="bugs"><?php echo $this->__('Frequently Asked Questions') ?> - <a href="faq" onclick="setLocation('<?php echo Mage::getUrl('faq/index/index'); ?>')"><strong><?php echo $this->__('FAQ') ?></strong></a> </p>
    </div>
</div>

Is this steps are correct or wrong? Please suggest/guide me how to override like all files in page Module?

Can any one tell me where I went wrong?

thanks.

1

page.xml is an already existing layout XML. Please rename to, for example, easylifepage.xml.

But since you're only doing minor layout tweaks might I suggest using the local.xml in favour of your own extension just to include a layout xml. This will eliminate the need for creating your own extension.

0

First of all make sure that you layout xml is called. Put this code instead yours.

<default>
    <remove name="header" />
</default>

Clear cache. As a result your pages should not contain header.

After you can use this code which is the correct way of customizing page templates

<default>
    <reference name="root">
        <reference name="header">
            <action method="setTemplate"><template>path/to/header/template.phtml</template></action>
        </reference>
        <reference name="footer">
            <action method="setTemplate"><template>path/to/footer/template.phtml</template></action>
        </reference>
    </reference>
</default>

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.