Magento Resource | E-Commerce Generation Explorer

Jun/09

13

How to Edit the Magento Footer Area

For Footer Area, we need edit two different locations.
One part is a static block which created within the magento admin area (CMS > Static Block).

The other part is held as .phtml / .php / .xml files within the design files.

XML files location:
app/design/frontend/*/*/layout/page.xml

Here you will find some footer reference:

1
2
3
4
<block type="page/html_footer" name="footer" as="footer" template="page/html/footer.phtml">
<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>

Another XML files location:
app/design/frontend/*/*/layout/cms.xml


Here you will find some footer reference:

1
2
3
4
5
6
7
8
9
<reference name="footer">
<block type="cms/block" name="cms_footer_links" before="footer_links">
<!--
The content of this block is taken from the database by its block_id.
You can manage it in admin CMS -> Static Blocks
-->
<action method="setBlockId"><block_id>footer_links</block_id></action>
</block>
</reference>

You can see that the footer area of each page (page.xml) adds footer links via:
app/design/frontend/*/*/template/page/html/footer.phtml
This file contains a method to get it’s children HTML as referenced in the page.xml file – ($this->getChildHtml();)
app/design/frontend/*/*/template/page/switch.phtml
app/design/frontend/*/*/template/page/template/links.phtml

footer.phtml is basically a “shell” which includes the “report bugs to magento” text.
It also calls the getChildHtml method to get the rest in there.
One important part of the footer’s children HTML are the links:
The .phtml file , however, grabs links from the method “$this->getLinks()” found in the Block .php file controlling the template.
The Block file controlling this template is:
app/code/core/mage/page/Template/Links.php

However, here you will find that this only has generic code for entering links! But where are anothers?

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
<!–contacts.xml–>
<reference name=”footer_links”>
<action method=”addLink” translate=”label title” module=”contacts” ifconfig=”contacts/contacts/enabled”>
<label>Contact Us</label>
<url>contacts</url>
<title>Contact Us</title>
<prepare>true</prepare>
</action>
</reference>
 
<!–rss.xml–>
<reference name=”footer_links”>
<action method=”addLink” translate=”label title” module=”rss” ifconfig=”rss/config/active”>
<label>RSS</label>
<url>rss</url>
<title>RSS testing</title>
<prepare>true</prepare>
<urlParams/>
<position/>
<li/><a>class=”link-feed”</a>
</action>
</reference>
 
<!–catalogsearch.xml–>
<reference name=”footer_links”>
<action method=”addLink” translate=”label title” module=”catalogsearch” ifconfig=”catalog/seo/search_terms”>
<label>Search Terms</label>
<url helper=”catalogsearch/getSearchTermUrl” />
<title>Search Terms</title>
</action>
<action method=”addLink” translate=”label title” module=”catalogsearch”>
<label>Advanced Search</label>
<url helper=”catalogsearch/getAdvancedSearchUrl” />
<title>Advanced Search</title>
</action>
</reference>
 
<!–catalog.xml–>
<reference name=”footer_links”>
<action method=”addLink” translate=”label title” module=”catalog” ifconfig=”catalog/seo/site_map”>
<label>Site Map</label>
<url helper=”catalog/map/getCategoryUrl” />
<title>Site Map</title>
</action>
</reference>

These are all in .xml files so you can Create, Update, Delete these footer links.

Now, as for the other links (About Us and Customer Service) they are created in the Admin section as mentioned before. Admin > CMS > Static Blocks. They are referenced in cms.xml as shown above.

· ·

5 comments

  • Owen · 07/04/2010 at 02:14

    thanks for the tip,it’s very useful,i changed the footer,it works and looks pretty good!

  • Chandigarh Flowers · 19/09/2010 at 04:20

    Thanks for your guide. It works for me.

  • Teo · 16/01/2011 at 21:58

    This guide is very helpful to anyone working with Magento. But there is one thing which many of us are wondering. How to apply Language change with “About us” and “Customer service”. If we have more than one language in our shop, footer links change when we apply a different Language but “About us” and “Customer service” stay the same. Some help would really be appreciated.

  • kapil · 25/02/2011 at 09:52

    Thanks for your guide. It.s working fine me.

  • Imelda B · 21/12/2011 at 09:53

    Thank you so much for such a clear explanation, it works!!!

    Imelda from Los Angeles

Leave a Reply

<<

>>

Theme Design by devolux.nh2.me