Variable "entrySlug" does not exist Routing I currently have a routing set up as follows to enable an "Edit" entry page following on from this question 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



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.
If I'm not mistaken, I don't think setting up the route via the CP does the fancy advanced rule stuff described here. You'll therefore want to do that via the config/routes.php file with something like this:

'marketplace/&lt;authorSlug:[^\/]+&gt;/&lt;entrySlug:{slug}&gt;/edit' =&gt; ['template' =&gt; 'listings/_edit'],


Now authorSlug and entrySlug will be available for use in your listings/_edit.twig template...