How To Modify Footer Links in Magento

As we all know, the Magento E-Commerce System is a very powerful e-commerce tool. To achieve that power, it seems some simplicity must go away.

In one of our recent posts, we described how to do multiple stores in Magento utilizing symlinks and a few other tricks. Along those lines, there are a few more changes that need to be done to the code to truly give the additional Magento sites their unique individuality.

You may already know that you’ll want to assign a unique theme to each individual Magento store. If you’re using the modern theme and like it, simply rename a copy of the theme files and folders and place them in the appropriate directory. Now in Magento admin, assign these unique themes to the new store.

Once you’ve done that, you can go in to these theme files and make changes to individualize them. The only problem is, if you’re going to use CMS static blocks in Magento (and you should), you’re going to need the hard coded files within the new theme to call up those static blocks.

As an example, we have a truck accessories retail site utilizing Magento Commerce. This is our main site and all other sites use the method described in the “How To Do Multi Stores in Magento“. We also have a power tools retail site utilizing Magento E-Commerce, but of course that is a child of the main site. The footer on the main site has a link that says “About Summit Equipment”. This is a static block created in the Magento admin under CMS>Static Blocks with and identifier called “footer_links”. This is a stock Magento static block, which can be modified right in admin. But if we look at the power tools site, the footer links read the same. So how do we change the link to read “About Power Tools” instead. If we modify it in Magento admin, then it will be changed for all sites. So what we have to do is create a new static block with a unique name. In our example, we created a new static block in Magento admin and named the identifier as “footer_links_tools” and put the content in that block we wanted. Problem is, the hard coded files in Magento are still calling up “footer_links”!

So now, this is where the challenge comes. Which files within Magento control what static blocks are called up? Turns out, after a little research, we found a couple of files that control this little bit of code and changes must be made to both. On your server, go to the “/app/design/frontend/default/yourthemename/layout/cms.xml” file. Open that file, and for this example, you will see some code something like: name=”cms_footer_links. Modify that code, in our case to look like this: name=”cms_footer_links_tools. A bit further down in our code we see: <block_id>footer_links. We change that bit of code to read: <block_id>footer_links_tools.

Save that file.

Then, navigate on your server to “/app/design/frontend/default/yourthemename/template/page/html/footer.phtml”.

Find some code like: getChildHtml(’cms_footer_links

And change that code to: getChildHtml(’cms_footer_links_tools

Now, one last little bit. Go to Magento admin and go to System>Cache Management and refresh your cache. If you don’t do this, you wont see your changes.

If you follow these steps, you should now be seeing your new footer links on your Magento e-commerce site!

You must be logged in to post a comment.