Erdal G.
Erdal G.

Reputation: 2980

Magento - Remove "Contact Us" footer link, the clean way

First of all the context : I want to remove the "Contact Us" link from the footer. But I do not have any contacts.xml where I can comment it out as I'm building my own theme based on the blank one. So the prerequisite is to remove it with my local.xml with layout remove methods.

This is working for the advanced search :

<default>
    <reference name="footer_links">
        <action method="removeLinkByUrl"><url helper="catalogsearch/getAdvancedSearchUrl"/></action>
    </reference>
</default>

But this isn't working for "Contact Us" :

<default>
    <reference name="footer_links">
        <action method="removeLinkByUrl"><url>contacts</url></action>
    </reference>
</default>

(Also tried with adding module="contacts" in action's attributes)

What I'm doing wrong?

Upvotes: 5

Views: 8089

Answers (3)

stevec
stevec

Reputation: 154

Here is another option. update page.xml

<block type="page/template_links" name="footer_links2" as="footer_links2" template="page/template/links.phtml"/>

like this. then go to static block -> footer_links edit it as you like.

changing block name will prevent adding other links

Upvotes: 0

Paul Corda
Paul Corda

Reputation: 136

Well, easiest method i found is:

Create a basic custom module, with a helper class. In that helper class create a public function that returns: Mage::getBaseUrl() . 'contacts/' - which is the url to the contacts page. After that you can use that function in the layout action like so:

<reference name="footer_links">
    <action method="removeLinkByUrl">
        <url helper="module/getContactsUrl" />
    </action>
</reference>

Where: module - your custom module's name getContactsUrl - name of the function that returns the contacts url

You can name these as you like.

Upvotes: 5

Martin
Martin

Reputation: 2673

If you want to, you can disable the Contact Us function. You can do this from the admin panel of your Magento. After you log in go to System menu>Configuration>Contacts button in the General section on the left>Contact Us panel on the right. In the Contact Us panel there's a drop-down menu Enable Contact Us. Set it to No and click on the Save Config button in top right corner. This will remove the Contact Us page and link from the frontend. If you want to enable the function again, just set the Enable Contact Us drop-down menu to Yes.

If you only need to remove only link from all the website, update it in template phtml ...app/design/frontend/yourteplatepath/page/html/footer.phtml

Not needed to configure layout, beacuse, you will load and uload link and function in vain.

Upvotes: 5

Related Questions