Posting in the Magento forums has been disabled pending the implementation of a new and improved forum solution which should better serve the community.

For new questions please post at magento.stackexchange.com, the community-run support site for the Magento community. We will be providing updates on the new forum solution soon. For questions or concerns please email community@magento.com.

Magento Forum

How do I add a footer link pointing to a static page? 
 
Jason J
Sr. Member
 
Total Posts:  79
Joined:  2008-05-29
 

I would like to add a link to a static page to the footer links. How would I do this?

This is what I have come up with so far:

<reference name="footer_links">
    <
action method="addLink" translate="label title"><label>Privacy Policy</label><url>privacy_policy</url><title>Privacy Policy</title><prepare/><urlParams/></action>
</
reference>

This works to a point. It links to the Privacy Policy static page from *most* pages. However, it fails if the user is on the login page and certain other pages. On those pages it just seems to tag “privacy_policy” onto the end of the already-complex login URL. If a search engine hits that page it would descend into an endless loop with the URL growing in size.

Is there a helper that can be used to return a URL, or is there some way to turn this into an absolute URL by *dynamically* adding the current base URL to the URL given in the tag?

-- Jason

Edit: I looked at how the demo store adds the two CMS page links in the footer, and that seems to be done via a static block, using this as the URL:

{{store url=''}}about-magento-demo-store

Perhaps that is because there is no other simple way to do it from the layout XML files?

 
Magento Community Magento Community
Magento Community
Magento Community
 
Jason J
Sr. Member
 
Total Posts:  79
Joined:  2008-05-29
 

Okay, I have just gone for the workaround, as in the demo site: use a static block for links to CMS pages.

The way it was intended to be, is that I would have four groups of links in the footer, each group logically connected. Now, for each of these groups, some of the links are CMS pages, and some are from the URL helper functions. It just seems that these cannot be mixed - CMS page links can *only* go into a static block so that {{store url=’’}} can be used. Helper-type URLs (such as “My Account” and “Log In") can only go into the XML layout files (pushing the links into a link-type block) because they have conditions with them, e.g. only display “Log In” if you are not already logged in, something that cannot be done with static blocks.

In conclusion: I’ve got all the footer links I need, but they are not grouped into the groups that I ideally wanted.  If there is a simple way around this, then I would love to know.

-- Jason

 
Magento Community Magento Community
Magento Community
Magento Community
 
Ciobi
Jr. Member
 
Total Posts:  10
Joined:  2009-08-11
 

Magento allows us to add direct links using the “addLink” method. Since the url of a static page is composed from the domain and the page id, this method achieves the desired effect:

<reference name="footer_links">
      <
action method="addLink" translate="label title" before="whatever"><label>My static page</label><url>/static-page-id</url><title>My static page</title></action>
</
reference>
This would result in adding another anchor element to the footer_links list that looks like this:
<a title="My static page" href="http://mydomain.com/static-page-id">My static page</a>
 
Magento Community Magento Community
Magento Community
Magento Community
 
TechNWeb LLC
Member
 
Avatar
Total Posts:  44
Joined:  2008-10-29
Austin, TX
 

This wont work if you have multiple sites or use staging capabilities within Magento.

 
Magento Community Magento Community
Magento Community
Magento Community
 
snowjamltd
Jr. Member
 
Total Posts:  9
Joined:  2011-08-15
 

See my blog post http://magento-myguide.blogspot.com/2012/01/adding-links-to-footer-bar.html

Really easy just need to add a line of code to the backoffice

Backoffice > CMS > CMS blocks > Footer Links

 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
Back to top