Answers.Body: <p>Here is Craft CMS 3 solution:</p>
  
  <p><a href="http://craftsnippets.com/articles/quick-edit" rel="nofollow noreferrer">http://craftsnippets.com/articles/quick-edit</a></p>
  
  <p>It works both with entries and categories and it takes multiple things into account while deciding if edit link should be displayed:</p>
  
  <ul>
  <li>If the current user has access rights to control panel?</li>
  <li>If the current user has rights to edit current entry/category?</li>
  <li>If entry/category is not displayed through live preview?</li>
  </ul>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-03-30T10:54:43.510Z
Answers.LastActivityDate: 2019-03-30T10:54:43.510Z
Answers.UserDisplayName: Piotr Pogorzelski
Answers.Body: <p>There is! It's called <a href="http://buildwithcraft.com/classreference/models/EntryModel#cpEditUrl-detail" rel="noreferrer">cpEditUrl</a>.</p>
  
  <pre><code>{% if currentUser %}
     {% if currentUser.isInGroup('admin') %}
         &lt;a href="{{ entry.cpEditUrl }}"&gt;Edit entry&lt;/a&gt;
     {% endif %}
  {% endif %}
  </code></pre>
  
  <p>Or shorter (thanks to MISC):</p>
  
  <pre><code>{% if currentUser.admin %}
      &lt;a href="{{ entry.cpEditUrl }}"&gt;Edit entry&lt;/a&gt;
  {% endif %}
  </code></pre>
  
  <p>Or forget user group altogether (thanks to Phil Gyford and bennobo):</p>
  
  <pre><code>{% if entry.isEditable() %}
      &lt;a href="{{ entry.cpEditUrl }}"&gt;Edit entry&lt;/a&gt;
  {% endif %}
  </code></pre>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-07-09T12:56:19.777Z
Answers.Text: Alternatively, you can use `{% if entry.isEditable() %}` as in this answer: http://craftcms.stackexchange.com/questions/130/how-can-i-grant-front-end-access-to-an-entry-that-belongs-to-the-current-user
Answers.UserDisplayName: Phil Gyford
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-08-02T06:50:46.920Z
Answers.Text: Or even shorter: {% if currentUser.admin %}
Answers.UserDisplayName: MISC
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-02-10T23:33:03.157Z
Answers.Text: You are the man, Douglas!
Answers.UserDisplayName: taylor
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-05-25T22:30:44.273Z
Answers.Text: I think that `{% if entry.isEditable() %}` is the way to go as it totally forgets the user/group logic. It's just one simple question: **Can you edit?**
Answers.UserDisplayName: bennobo
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-02-10T23:28:59.397Z
Answers.LastActivityDate: 2016-05-27T16:49:17.163Z
Answers.LastEditDate: 2016-05-27T16:49:17.163Z
Answers.UserDisplayName: Douglas McDonald
Body: <p>I want to add an "Edit entry" button on each page for admin users. Am I overlooking a simple way to output the Edit link to the CP edit page for the current entry? Curious if there is something like <code>{{ entry.editLink }}</code></p>
  
Tags: <templating><control-panel>
Title: Get Entry Edit Link in Twig
ThreadText: # Get Entry Edit Link in Twig
  
  (Asked by: username_0 on 2015-02-10)
  
  I want to add an "Edit entry" button on each page for admin users. Am I overlooking a simple way to output the Edit link to the CP edit page for the current entry? Curious if there is something like `{{ entry.editLink }}`
  
  **Tags:** templating, control-panel
  
  
  ---
  
  ## 2 answers
  
  ### Answer by username_2 on 2015-02-10. Score: 23 | Accepted answer
  
  There is! It's called [cpEditUrl](http://buildwithcraft.com/classreference/models/EntryModel#cpEditUrl-detail).
  
  ```
  {% if currentUser %}
     {% if currentUser.isInGroup('admin') %}
         <a href="{{ entry.cpEditUrl }}">Edit entry</a>
     {% endif %}
  {% endif %}
  
  ```
  
  Or shorter (thanks to username_4):
  
  ```
  {% if currentUser.admin %}
      <a href="{{ entry.cpEditUrl }}">Edit entry</a>
  {% endif %}
  
  ```
  
  Or forget user group altogether (thanks to username_3 and username_5):
  
  ```
  {% if entry.isEditable() %}
      <a href="{{ entry.cpEditUrl }}">Edit entry</a>
  {% endif %}
  
  ```
  
  > **Comments:**
  > **username_0**: You are the man, username_2!  
  > **username_3**: Alternatively, you can use `{% if entry.isEditable() %}` as in this answer: http://craftcms.stackexchange.com/questions/130/how-can-i-grant-front-end-access-to-an-entry-that-belongs-to-the-current-user  
  > **username_4**: Or even shorter: {% if currentUser.admin %}  
  > **username_5**: I think that `{% if entry.isEditable() %}` is the way to go as it totally forgets the user/group logic. It's just one simple question: **Can you edit?**  
  
  ---
  
  ### Answer by username_1 on 2019-03-30. Score: 1
  
  Here is Craft CMS 3 solution:
  
  <http://craftsnippets.com/articles/quick-edit>
  
  It works both with entries and categories and it takes multiple things into account while deciding if edit link should be displayed:
  
  * If the current user has access rights to control panel?
  * If the current user has rights to edit current entry/category?
  * If entry/category is not displayed through live preview?
  
  
  ---
  
  