Insert, remove, edit Magento footer links

Insert, remove, edit Magento footer links

This post is based on the default theme included in Magento, but it’s valid for the majority of the themes available for Magento.

In a footer made using Magento there is a list of links pointing to website pages; in other CMS add, remove or edit these is quite easy, while in Magento the edit could be a bit problematic.

The link inserted in footer by Magento are of two types:

  1. link to pages created via administration backend (like About Us or Customer Service);
  2. link to Magento default pages (like Advanced Search, Contact Us or Site map).

Magento footer links

The method to edit the two types of links are totally different, let’s see in details both of them.

1. Link to pages created via administration backend

To edit this type of link it should be enough to use only the administration backend of Magento, without the need to edit directly source files.

Inside the administration go to CMS ? Static Blocks, inside it you should find a page called Footer Links with identifier footer_links, if you have a static block like this you could directly edit it from the backend for inserting, removing or changing the links.

If inside the Static Blocks you don’t have a page with the identifier equal or similar to footer_links, try to create a new static block inserting as identifier footer_links and add the links inside it.

If this edit doesn’t return any positive result, you have to directly edit the code in source files: open the file cms.xml that you could find inside the layout folder of your theme

/app/design/frontend/*/*/layout/cms.xml

Find the line of code

<reference name="footer">

Inside it there is a block that insert the links in the footer.
The name that you find between <block_id> and </block_id> is the identifier to use in the static block previously seen. If this name and the one of the block identifier are different, change the name directly in file or edit the identifier of the static block.
My suggestion is to edit the identifier and more in general to avoid, where possible, to edit directly the source files.

If also after this last editing you cannot add, remove or edit your links as expected, you could contact me for a free analysis of your needs, sending an email using the contact form module that you could find on contacts page.

2. Link to Magento default pages

To edit these typology of link you have to edit directly the source files.

This kind of links are added to the footer through specific instructions inserted in the .xml files that you could find inside the layout folder of your theme.

As example I use the link Site Map, but the procedure is repeatable also for the other links.

Open the file catalog.xml that you could find inside the layout folders of your theme

/app/design/frontend/*/*/layout/catalog.xml

Inside this search the code

<reference name="footer_links">

Inside this tag you should see an action code with the method attribute value equal to addLink, if you want to delete from your footer the link to the sitemap you have to delete or comment this line as this

<!–<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>–>

or if you want to change the name of the link from Site Map to Sitemap you have to change the text wrapped between <label> and </label>

<action method="addLink" translate="label title" module="catalog" ifconfig="catalog/seo/site_map"><label>Sitemap</label><url helper="catalog/map/getCategoryUrl" /><title>Site Map</title></action>

To edit the other footer links you have to explore the various .xml available inside the layout folder;
as example the links Search Terms and Advanced Search are inserted in the file catalogsearch.xml while Contact Us is defined in contacts.xml.

If after these changes the links are not edited as wanted, you could contact me for a free analysis of your needs, sending an email using the contact form module that you could find on contacts page.

2 comments on Insert, remove, edit Magento footer links

  1. Thank you so much for this! I was struggling trying to figure out how to do this. I had a question though, do you know how to make the sub-menus open so that they’re aligned on the right instead of aligned on the left?

    1. Yes, I know it! 🙂

      If you want to align the submenus on the right
      find
      #access ul ul {
      inside it substitute
      left: 0;
      width
      right: 0;

      If you want to align the text of submenus also on the right
      find
      #access ul ul li {
      and add inside it
      text-align: right;

      And last, if you want that second level submenus appears on the left side
      find
      #access ul ul ul {
      inside it substitute
      left: 100%;
      width
      right: 100%;

      And now your submenus should be on a right-to-left style 😉

Leave a Reply

Your email address will not be published. Required fields are marked *