I would like to add a "logout" link to a Magento shop, that i am developing.
In the page "My account", left sidebar under all the links (last link at the bottom):
How do I add a link at the bottom?
I think that I should add a line of code in customer.xml.
I guess it should be in this block:
<block type="customer/account_navigation" name="customer_account_navigation" before="-" template="customer/account/navigation.phtml">
<action method="addLink" translate="label" module="customer"><name>account</name><path>customer/account/</path><label>Account Dashboard</label></action>
<action method="addLink" translate="label" module="customer"><name>account_edit</name><path>customer/account/edit/</path><label>Account Information</label></action>
<action method="addLink" translate="label" module="customer"><name>address_book</name><path>customer/address/</path><label>Address Book</label></action>
</block>
And something in the line of:
<action method="addLink" translate="label" module="customer"><name>LOGOUT</name><path>LOGOUT_PATH</path><label>Logout</label></action>
I'm just not sure what the exact code should be.
Thanks in advance for any help
While your solution works, it is considered best practice to make all layout changes within the file app/design/frontend/your_package/your_theme/layout/local.xml
and refrain from editing the other layout files directly.
For this change, your local.xml would look like:
<?xml version="1.0"?>
<layout version="0.1.0">
<customer_account>
<reference name="left">
<reference name="customer_account_navigation">
<action method="addLink" translate="label" module="customer">
<name>logout</name>
<path>customer/account/logout/</path>
<label>Log Out</label>
</action>
</reference>
</reference>
</customer_account>
</layout>
local.xml Reference
A good resource to start using local.xml is on this page:
Classy Llama's Better Way to Modify Magento Layout
Article would be better without the word wrapping but they cover most of the means of editing your layout.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With