Search This Blog

Jan 26, 2012

Magento: Removing Footer Links, copyright, and store switcher

Most of magento site does not necessarily used multi-store set up and usually used simple design compare to the default template of magento. With that said, there are lot of unnecessary section that are presents in the default template that need to be taken out. Footer section is one of them. Magento default template includes default footer links, copyright and report bugs text that are not necessarily needed or we can say that it is need to be change.

Here is the default code of the footer.phtml.

<div class="footer-container">
    <div class="footer">
        <?php echo $this->getChildHtml() ?>
        <p class="bugs"><?php echo $this->__('Help Us to Keep Magento Healthy') ?> - <a href="http://www.magentocommerce.com/bug-tracking" onclick="this.target='_blank'"><strong><?php echo $this->__('Report All Bugs') ?></strong></a> <?php echo $this->__('(ver. %s)', Mage::getVersion()) ?></p>
        <address><?php echo $this->getCopyright() ?></address>
    </div>
</div>

To remove the copyright text, just alter the code below. If you don't want to remove / or you only need to edit this. You need to login on your Admin Panel and go to System -> Configuration. In General Tab, click Design. Then, in the footer section, you can see the copyright textarea. You can edit the default copyright text there.

<address><?php echo $this->getCopyright() ?></address>

You don't need the Report Bug section so you can delete it by removing the following code.

 <p class="bugs"><?php echo $this->__('Help Us to Keep Magento Healthy') ?> - <a href="http://www.magentocommerce.com/bug-tracking" onclick="this.target='_blank'"><strong><?php echo $this->__('Report All Bugs') ?></strong></a> <?php echo $this->__('(ver. %s)', Mage::getVersion()) ?></p>  

Footer links and store switcher are not defined directly on the footer.phtml file. They are defined on page.xml  which can be seen in this directory  - app/design/frontend/default/[your-theme-name]/layout/. Around line 99 of the page.xml file you will see the code below. This is the block element that hold the footer links, bottom container, and store switcher.

<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" template="page/template/links.phtml"/>  

</block>

To remove the store switcher, just delete this code:

<block type="page/switch" name="store_switcher" as="store_switcher" template="page/switch/stores.phtml"/>

To remove the footer links, remove this code:

<block type="page/template_links" name="footer_links" as="footer_links" template="page/template/links.phtml"/>  

Save the footer.phtml and clear your cache.

Important: If you don’t find the footer. phtml and page.xml in your theme folder - copy these files from base package to your theme folder:

app/design/frontend/base/default/layout/page.xml
app/design/frontend/base/default/template/page/html/footer.phtml

0 comments: