Posted By

kayue on 12/31/10


Tagged


Versions (?)

Magento footer link operations


 / Published in: XML
 

  1. <?xml version="1.0"?>
  2. <!-- http://classyllama.com/development/magento-development/editing-magentos-footer-links/ -->
  3. <layout version="0.1.0">
  4. <default>
  5. <reference name="footer_links">
  6. <!-- Add custom links. Pretty self-explanatory.
  7. Dig into app/code/core/Mage/Page/Block/Template/Links.php for more info -->
  8. <action method="addLink" translate="label title">
  9. <label>About Us</label>
  10. <url>about</url> <!-- can use a full url if not using urlParams below -->
  11. <title>About Us</title>
  12. <prepare>true</prepare> <!-- set true if adding base url param -->
  13. <urlParams helper="core/url/getHomeUrl"/> <!-- base url - thanks @Russ! -->
  14. <!-- there are a few param you can send to do different things in <urlParams>
  15. dig into app/code/core/Mage/Core/Model/Url.php, around line 803 -->
  16.  
  17. <!-- below adds #add-fragment to the end of your url -->
  18. <!-- <urlParams><_fragment>add-fragment</_fragment></urlParams> -->
  19.  
  20. <!-- below adds ?add-query to the end of your url -->
  21. <!-- <urlParams><_query>add-fragment</_query></urlParams> -->
  22.  
  23. <!-- below gives you a new session id (i think...)-->
  24. <!-- <urlParams><_nosid>true</_nosid></urlParams> -->
  25.  
  26. <!-- below replaces double quotes, single quotes, greater than, and less than signs
  27. to their respective url escaped replacements (%22, %27, %3E, %3C) -->
  28. <!-- <urlParams><_escape>i'm-a-blog-url</_escape></urlParams> -->
  29.  
  30. <position>1</position>
  31. <liParams/>
  32. <aParams>class="top-link-about-us"</aParams>
  33. <beforeText></beforeText>
  34. <afterText></afterText>
  35. </action>
  36.  
  37. <!-- Remove 'Site Map' Link - Default Position: 10
  38. Original link adding in catalog.xml -->
  39. <action method="removeLinkByUrl"><url helper="catalog/map/getCategoryUrl" /></action>
  40.  
  41. <!-- Remove 'Search Terms' Link - Default Position: 20
  42. Original link adding in catalogsearch.xml-->
  43. <action method="removeLinkByUrl"><url helper="catalogsearch/getSearchTermUrl" /></action>
  44.  
  45. <!-- Remove 'Advanced Search' - Default Position: 30
  46. Original link adding in catalogsearch.xml-->
  47. <action method="removeLinkByUrl"><url helper="catalogsearch/getAdvancedSearchUrl" /></action>
  48.  
  49. <!-- Remove 'Contact Us' link - Original link in contacts.xml
  50. <!-- Best bet to go to Magento's Admin > System > Configuration > (left sidebar) Contacts
  51. > Contact Us Enabled = NO -->
  52. <!-- You can pass the full url, which is a hassle if you have dev and stage sites -->
  53. <action method="removeLinkByUrl"><url>http://YOUR_SITE.com/contacts/</url></action>
  54. <!-- see comments below for making a custom helper to remove contacts link
  55. no matter what your base url is -->
  56. </reference>
  57.  
  58. <!-- By default, Magento sets a static footer block. Find it in the admin under
  59. CMS > Static Blocks.
  60. <reference name="footer">
  61. <!-- Remove Magento's default static block and use the 'addLink' method above
  62. to add your custom and inline links. I use the 'unsetChild' method as often as
  63. possible as opposed using the more final <remove name="cms_footer_links"/>
  64. just in case I want to add the block somewhere else -->
  65. <action method="unsetChild"><name>cms_footer_links</name></action>
  66.  
  67. <!-- Remove all the other Magento links - "Site Map, Search Terms, Advanced Search, and
  68. Contact Us" -->
  69. <action method="unsetChild"><name>footer_links</name></action> <!-- Magento 1.4.x -->
  70. </reference>
  71. </default>
  72. </layout>

Report this snippet  

You need to login to post a comment.