We have added the customer account links in manually with our local.xml file like so:

<reference name="right">
        <block type="customer/account_navigation" name="customer_account_navigation" after="-" template="customer/account/navigation.phtml">
            <action method="addLink" translate="label" module="customer">
                <label>My Account</label>

I now need to be able to get this list of links in the header template. I have create a block like so:

<block name="header.topbar.account" as="header-topbar-account" type="customer/account_navigation" template="johnsmedleytheme/page/header/topbar/account.phtml"/>

Wrapped in the header reference tag. and in my phtml i am currently calling:


In order to retrieve the customer account nav links. But the array is returning empty.

Any ideas?


  • are you want to show account link on header
    – Amit Bera
    Aug 29, 2014 at 15:33
  • Yes there will be an if to see if user is logged in or not etc and if they are we want to show some of the account links
    – Tom Burman
    Aug 29, 2014 at 15:37
  • your template is adding correctly in layout ? Aug 29, 2014 at 15:40
  • @Marius : I was unaware of this. So i delete my answer. Thanks for that great insight Aug 29, 2014 at 15:46
  • that means......only logged in customer will see the link?
    – Amit Bera
    Aug 29, 2014 at 15:48

1 Answer 1


1)create new layout in default.

 <reference name="mytoplinks">
        <block type="customer/account_navigation" name="customer_account_navigation" 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>

2)create an event on controller_action_layout_load_before.


3) update this using event.

 public function beforeLoadLayout($observer)
        $loggedIn = Mage::getSingleton('customer/session')->isLoggedIn();


4)just define on local.xml

    <reference name="header">
    <block type="core/template" name="mytoplinks" as="mytoplinks"/>
  • it not test.. totally on concept...
    – Amit Bera
    Aug 29, 2014 at 15:58
  • This is totally new concept for me !. If this works, this would be a great answer. Aug 29, 2014 at 16:02
  • plus there is a small error that lyes inside layout file. You forgot to put reference name="header" /> node Aug 29, 2014 at 16:03
  • Cheers for the answer, this may be a last resort test! But right now can you see any issues with what i have done above? And why it may not be working the way i expected it too? Cheers
    – Tom Burman
    Sep 1, 2014 at 7:54

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.