Answers.Body: <p>Try this:</p>
  
  <pre><code>{% if currentUser.id == entry.author.id %}
  </code></pre>
  
  <p>When using quotation marks, it means that it's a string in Twig. What you want to do is compare the value of the actual variable.</p>
  
  <p>Also, <code>currentUser</code> is a UserModel, so you need to get the id property to compare it with <code>entry.author.id</code>.</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2018-03-21T16:34:14.373Z
Answers.Text: Yes, that works although I'm sure I tried it!
Answers.UserDisplayName: Andrew
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2018-03-21T16:17:29.683Z
Answers.LastActivityDate: 2018-03-21T16:55:15.803Z
Answers.LastEditDate: 2018-03-21T16:55:15.803Z
Answers.UserDisplayName: André Elvan
Body: <p>How can I compare the results of currentUser and entry.author on an entry page?
  I've tried the following, but none of these get a positive result:</p>
  
  <pre><code>{% if  currentUser == 'entry.author.id' %}
  </code></pre>
  
  <p>Or </p>
  
  <pre><code>{% set author %}{{ entry.author.id }}{% endset %}
  {{ author }}
  {% if currentUser.id == '{{ author }}' %}
  </code></pre>
  
  <p>(I'm aiming to provide a way for the author of an entry to be presented with a form to edit the entry)</p>
  
Tags: <author><current-user>
Title: How to compare currentUser with entry.author?
ThreadText: # How to compare currentUser with entry.author?
  
  (Asked by: username_0 on 2018-03-21)
  
  How can I compare the results of currentUser and entry.author on an entry page?
  I've tried the following, but none of these get a positive result:
  
  ```
  {% if  currentUser == 'entry.author.id' %}
  
  ```
  
  Or
  
  ```
  {% set author %}{{ entry.author.id }}{% endset %}
  {{ author }}
  {% if currentUser.id == '{{ author }}' %}
  
  ```
  
  (I'm aiming to provide a way for the author of an entry to be presented with a form to edit the entry)
  
  **Tags:** author, current-user
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2018-03-21. Score: 2 | Accepted answer
  
  Try this:
  
  ```
  {% if currentUser.id == entry.author.id %}
  
  ```
  
  When using quotation marks, it means that it's a string in Twig. What you want to do is compare the value of the actual variable.
  
  Also, `currentUser` is a UserModel, so you need to get the id property to compare it with `entry.author.id`.
  
  > **Comments:**
  > **username_0**: Yes, that works although I'm sure I tried it!  
  
  ---
  
  