Posting in the Magento forums has been disabled pending the implementation of a new and improved forum solution which should better serve the community.

For new questions please post at magento.stackexchange.com, the community-run support site for the Magento community. We will be providing updates on the new forum solution soon. For questions or concerns please email community@magento.com.

Magento Forum

show top.links only when a user is logged in…
 
Jayson44
Member
 
Total Posts:  36
Joined:  2009-08-17
 

I’ve moved the top links to the right sidebar in my layout, however, I only want to show them when a user is logged in.  I’ve done this with the mini-login form and it seems to work just fine (meaning: it shows up when you’re not logged in and dissappears when you are logged in).

I thought I could modify my customer.xml file to say:

<customer_logged_in>
        <
reference name="top.links">
            <
action method="addLink" translate="label title" module="customer"><label>Log Out</label><url helper="customer/getLogoutUrl"/><title>Log Out</title><prepare/><urlParams/><position>100</position></action>
        </
reference>
        <
reference name="right">
            <
block type="page/template_links" before="-" name="top.links" as="topLinks"/>
        </
reference>
    </
customer_logged_in>

I added the

<reference name="right">
            <
block type="page/template_links" before="-" name="top.links" as="topLinks"/>
        </
reference>
the same way I added it for the login under the <customer_logged_out> but it doesn’t seem to work.  any ideas?

oh yeah, and I had originally moved the following code in the page.xml file from the <block type="page/html_header" name="header" as="header"> to the <block type="page/html_right" name="right" as="right"> :

<block type="page/template_links" name="top.links" as="topLinks"/>

this moved the links from the header to the right sidebar.  I’ve tried deleting this line so it doesn’t automatically show in the sidebar, but that’s not helping.  it just doesn’t show at all.  any ideas would be appreciated.

J.

 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
Back to top