I've had a good search around and found the customer_logged_in
and customer_logged_out
tags but I can't get them to work properly, this I'm sure is down to my misunderstanding of them.
My goal is to hide the log in, account and checkout links from the block top.links
when the user is not logged in and show them when the user is logged in.
I have placed the following at the end of my local.xml
file to try and remove the log in link:
<customer_logged_in>
<reference name="top.links">
<action method="removeLinkByUrl"><url helper="customer/getLoginUrl"/></action>
</reference>
</customer_logged_in>
</default>
But it does not work. Can someone please explain why this does not work? It's driving me crazy!
Removing links in local.xml works in my case. Here is the code:
<customer_logged_in>
<reference name="top.links">
<action method="removeLinkByUrl"><url helper="customer/getLogoutUrl"/></action>
</reference>
</customer_logged_in>
<customer_logged_out>
<reference name="top.links">
<action method="removeLinkByUrl"><url helper="customer/getLoginUrl"/></action>
</reference>
</customer_logged_out>