Shopify themes, liquid, logos, and UX
Hello,
I would like to add a text link (vs. the theme's icon) that says LOGIN when a customer is not signed in and says LOGOUT when a customer is signed in.
This will not go in the header where the default icon is. I will put it in another section.
Can you help me with the liquid code to add this to a section of my choice?
TL;DR:
How do I create a dynamic login/logout link that says LOGIN or LOGOUT depending on the viewer's status that I can use elsewhere in the site besides the Header?
Thank you!
Solved! Go to the solution
This is an accepted solution.
you can start with this code:
{% if customer %}
<a href="/account/logout">Logout</a>
{% else %}
<a href="/account/login">Login</a>
{% endif %}
This is an accepted solution.
you can start with this code:
{% if customer %}
<a href="/account/logout">Logout</a>
{% else %}
<a href="/account/login">Login</a>
{% endif %}
Thank you so much. I can't believe it was that easy.
By investing 30 minutes of your time, you can unlock the potential for increased sales,...
By Jacqui Sep 11, 2024We appreciate the diverse ways you participate in and engage with the Shopify Communi...
By JasonH Sep 9, 2024Thanks to everyone who participated in our AMA with 2H Media: Marketing Your Shopify St...
By Jacqui Sep 6, 2024