Answers.Body: <p>If I'm not mistaken, I don't think setting up the route via the CP does the fancy advanced rule stuff described <a href="https://docs.craftcms.com/v3/routing.html#advanced-routing-with-url-rules" rel="nofollow noreferrer">here</a>. You'll therefore want to do that via the <code>config/routes.php</code> file with something like this:</p>
  
  <pre><code>'marketplace/&lt;authorSlug:[^\/]+&gt;/&lt;entrySlug:{slug}&gt;/edit' =&gt; ['template' =&gt; 'listings/_edit'],
  </code></pre>
  
  <p>Now <code>authorSlug</code> and <code>entrySlug</code> will be available for use in your <code>listings/_edit.twig</code> template...</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2018-11-28T16:38:51.787Z
Answers.LastActivityDate: 2018-11-28T17:15:02.173Z
Answers.LastEditDate: 2018-11-28T17:15:02.173Z
Answers.UserDisplayName: Jalen Davenport
Body: <p>I currently have a routing set up as follows to enable an "Edit" entry page following on from <a href="https://craftcms.stackexchange.com/questions/28565/edit-entry-page/28571#28571">this question</a> but I'm getting the following error message when going to that page.</p>
  
  <blockquote>
    <p>Variable "entrySlug" does not exist</p>
  </blockquote>
  
  <p>I have my routing set up as follows within my CP, which loads a URL like so <code>mydomain.com/marketplace/authorname/entryname/edit</code></p>
  
  <p><a href="https://i.sstatic.net/deO5g.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/deO5g.png" alt="enter image description here"></a></p>
  
  <p>and within my <code>listings/_edit</code></p>
  
  <pre><code>{# Find the entry by slug and author: #}
  {% set listing = craft.entries({
      section: 'networks',
      slug: entrySlug,
      author: currentUser
  }).one() %}
  </code></pre>
  
  <p>I'm really unsure why it can't find the slug of the entry.</p>
  
Tags: <templating><routes><routing>
Title: Variable "entrySlug" does not exist Routing
ThreadText: # Variable "entrySlug" does not exist Routing
  
  (Asked by: username_0 on 2018-11-28)
  
  I currently have a routing set up as follows to enable an "Edit" entry page following on from [this question](https://craftcms.stackexchange.com/questions/28565/edit-entry-page/28571#28571) but I'm getting the following error message when going to that page.
  
  > Variable "entrySlug" does not exist
  
  I have my routing set up as follows within my CP, which loads a URL like so `mydomain.com/marketplace/authorname/entryname/edit`
  
  [![enter image description here](https://i.sstatic.net/deO5g.png)](https://i.sstatic.net/deO5g.png)
  
  and within my `listings/_edit`
  
  ```
  {# Find the entry by slug and author: #}
  {% set listing = craft.entries({
      section: 'networks',
      slug: entrySlug,
      author: currentUser
  }).one() %}
  
  ```
  
  I'm really unsure why it can't find the slug of the entry.
  
  **Tags:** templating, routes, routing
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2018-11-28. Score: 3 | Accepted answer
  
  If I'm not mistaken, I don't think setting up the route via the CP does the fancy advanced rule stuff described [here](https://docs.craftcms.com/v3/routing.html#advanced-routing-with-url-rules). You'll therefore want to do that via the `config/routes.php` file with something like this:
  
  ```
  'marketplace/<authorSlug:[^\/]+>/<entrySlug:{slug}>/edit' => ['template' => 'listings/_edit'],
  
  ```
  
  Now `authorSlug` and `entrySlug` will be available for use in your `listings/_edit.twig` template...
  
  
  ---
  
  