What conditional statement would hide a form if a user is logged in?

1 Answer 1


The Twig variable currentUser contains information about the currently logged in user, and will be null if no user is currently logged in.

{% if not currentUser %}

    <!-- Your login form -->

{% endif %}

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.