Add a dynamic Login/logout text link on the Dawn theme

Topic summary

A user seeks to add a dynamic text link that displays “LOGIN” for signed-out customers and “LOGOUT” for signed-in customers, positioned outside the default header icon location in a custom section.

Solution Provided:

  • Another participant shared Liquid code using conditional logic ({% if customer %}) to check customer authentication status
  • The code dynamically renders either “Login” or “Logout” text based on whether a customer is signed in

Outcome:

  • The original poster confirmed the solution worked successfully and was straightforward to implement
  • The discussion appears resolved with a working code snippet provided
Summarized with AI on November 17. AI used: claude-sonnet-4-5-20250929.

you can start with this code:

{% if customer %}

Logout

{% else %}

Login

{% endif %}
2 Likes