0

I've been able to manipulate the links that are included in the "top.links" section, add three new links, and specify that the login/logout links and My Account link be revealed/hidden as appropriate, but I can't figure out how to change the order of the links.

I would like to have the "account" and "login/logout" links grouped together without being split by the cart link. Like so:

LINK | LINK | LINK | MY CART | MY ACCOUNT | LOG OUT

And the order is fine when not logged in (because the account link does not appear:

LINK | LINK | LINK | MY CART (1 item) | LOG IN

But when the customer is logged in the account link shows up on the other side of the cart link (or the cart link pops up between the account link and the login/logout link):

LINK | LINK | LINK | MY ACCOUNT | MY CART | LOG OUT

I used this, in "local.xml" to remove the default checkout/cart links and then add back in only the cart link:

<reference name="top.links">
  <remove name="checkout_cart_link"/>

  <block type="checkout/links" name="checkout_cart_link_custom">
    <action method="addCartLink"></action>
    <!--<action method="addCheckoutLink"></action>-->
  </block>
</reference>

But for some reason, when the account and login/logout links are displayed, the cart link splits them and is displayed between the account link and the login/logout link. Like so:

LINK | LINK | LINK | MY ACCOUNT | MY CART | LOG OUT

This (from an old blog post) is used to control which account and login/logout links are displayed:

<customer_logged_in>
    <!-- Removes 'Log In' link - Default position: 60 -->
    <reference name="top.links">
        <action method="removeLinkByUrl"><url helper="customer/getLoginUrl"/></action>
    </reference>
</customer_logged_in>

<customer_logged_out>
    <!-- Removes 'Log Out' link - Default position: 60 -->
    <reference name="top.links">
        <action method="removeLinkByUrl"><url helper="customer/getLogoutUrl"/></action>
        <action method="removeLinkByUrl"><url helper="customer/getAccountUrl"/></action>
    </reference>
</customer_logged_out>

I see that in the comments, there is are references to the "Default position: 60" for the login/logout links, and I think this may be the key to what I'm trying to do, but I haven't been able to work out the syntax of specifying the position.

How do I specify the position for these links? What is the syntax?

Your Answer

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

Browse other questions tagged or ask your own question.