Answers.Body: <p>The Twig variable <a href="http://buildwithcraft.com/docs/templating/global-variables#currentUser" rel="nofollow"><code>currentUser</code></a> contains information about the currently logged in user, and will be <em>null</em> if no user is currently logged in.</p>
  
  <pre><code>{% if not currentUser %}
  
      &lt;!-- Your login form --&gt;
  
  {% endif %}
  </code></pre>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2014-10-07T17:20:43.583Z
Answers.LastActivityDate: 2014-10-07T17:20:43.583Z
Answers.UserDisplayName: Lindsey D
Body: <p>What conditional statement would hide a form if a user is logged in?</p>
  
Tags: <form><conditional>
Title: How do I hide a login form if user is logged in?
ThreadText: # How do I hide a login form if user is logged in?
  
  (Asked by: username_0 on 2014-10-07)
  
  What conditional statement would hide a form if a user is logged in?
  
  **Tags:** form, conditional
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2014-10-07. Score: 4 | Accepted answer
  
  The Twig variable [`currentUser`](http://buildwithcraft.com/docs/templating/global-variables#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 %}
  
  ```
  
  
  ---
  
  