Answers.Body: <p><code>profile.cpEditUrl</code> is what you're looking for.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-09-19T08:11:47.030Z
Answers.Text: So easy, thank you!
Answers.UserDisplayName: Jamie Wade
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-09-18T16:05:55.517Z
Answers.LastActivityDate: 2019-09-18T16:05:55.517Z
Answers.UserDisplayName: dmatthams
Body: <p>Assuming I am fetching an entry like so:</p>
  
  <p><code>{% set profile = craft.entries.id(8268).one %}</code></p>
  
  <p>What is the easiest way to generate a link that allows you to edit that entry in Craft? I know you can do the following:</p>
  
  <p><code>{{ siteUrl ~ 'admin/entries/profiles/' ~ profile.id }}</code></p>
  
  <p>But surely there must be a better way?</p>
  
Tags: <templating>
Title: What's the easiest way to generate a link to edit a given entry in Craft?
ThreadText: # What's the easiest way to generate a link to edit a given entry in Craft?
  
  (Asked by: username_0 on 2019-09-18)
  
  Assuming I am fetching an entry like so:
  
  `{% set profile = craft.entries.id(8268).one %}`
  
  What is the easiest way to generate a link that allows you to edit that entry in Craft? I know you can do the following:
  
  `{{ siteUrl ~ 'admin/entries/profiles/' ~ profile.id }}`
  
  But surely there must be a better way?
  
  **Tags:** templating
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2019-09-18. Score: 2 | Accepted answer
  
  `profile.cpEditUrl` is what you're looking for.
  
  > **Comments:**
  > **username_0**: So easy, thank you!  
  
  ---
  
  