1

I am trying to configure the customer account page for a 3column layout and I want to move the customer account navigation from its default position in the left column to the right column. So far I have tried this in the local.xml file of my own theme:

<customer_account_index>
    <reference name="root">
        <action method="setTemplate"><template>page/3columns.phtml</template></action>
    </reference>
    <reference name="left">
        <remove name="customer_account_navigation"/>
    </reference>
    <reference name="right">
        <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>
        </block>
    </reference>
</customer_account_index>

As expected, the customer account page will then have a 3 column layout and the customer account navigation is removed from the left column.

However, the navigation does not appear in the right column (any other block that is displayed by default in the right column is displayed as expected, so there is no general problem with the layout), and I am not sure why.

1

The problem was, that I used

<reference name="left">
    <remove name="customer_account_navigation"/>
</reference>

to remove the customer account navigation from the left column. This is problematic, because those <remove> actions will be executed after all layout handles are merged (see https://stackoverflow.com/a/6358263/374996). Thus the solution was to change the removal to

<reference name="left">
    <action method="unsetChild">
        <name>customer_account_navigation</name>
    </action>
</reference>

And even better: instead of building a new block (with <block …>…) you can use

<reference name="right">
    <action method="insert">
        <name>customer_account_navigation</name>
    </action>
</reference>

to re-insert the existing block into the right column.

So all in all, to move a block, in this case the customer_account_navigation, from the left column to the right column for example, all you need is

<reference name="left">
    <action method="unsetChild">
        <name>customer_account_navigation</name>
    </action>
</reference>
<reference name="right">
    <action method="insert">
        <name>customer_account_navigation</name>
    </action>
</reference>
0

name="right" will work whenever your account pages's are layout 2-columns-right,3-columns.

You may be need to change to <reference name="content"> from <reference name="right">

Also,you need change handler to customer_account from customer_account_indexbecause of customer_account handler is call at all customer account page

  • What do you mean? I am not using <reference name="content">. I am using <reference name="right">. See the code of my local.xml file in the original post. Also if I change <customer_account> to <customer_account_index> then nothing will work - everything will be back to its default state. i.e. the customer account index page will be back to its default 2column-left layout and the customer account navigation will be in the left column again. – fritzmg Apr 22 '16 at 10:00
  • change name="customer_account_navigation" to name="customer_account_navigation" and try – Amit Bera Apr 22 '16 at 10:06
  • as you have using 3column layout then you can use <reference name="right"> – Amit Bera Apr 22 '16 at 10:10

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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