Answers.Body: <p>Technically it's a combination of the element's slug plus URI that is required to be unique (on a per-locale basis).</p>
  
  <p>You can see the logic used and where it's enforced at the code level in <a href="https://github.com/pixelandtonic/Craft-Release/blob/master/app/helpers/ElementHelper.php#L74" rel="nofollow noreferrer"><code>ElementHelper::setUniqueURI()</code></a></p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-07-05T09:25:12.523Z
Answers.Text: Ah right, so this is expected behaviour in a Structure section then.
Answers.UserDisplayName: Clive Portman
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-07-05T18:29:45.277Z
Answers.Text: Assuming the nested entries setting for that Structure is set to `{parent.uri}/{slug}`, then yeah, there's a good chance it'll always be unique (unless they're on the same level in the Structure).
Answers.UserDisplayName: Brad Bell
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-07-06T08:28:30.823Z
Answers.Text: In our case that's what we need, so thank you.
Answers.UserDisplayName: Clive Portman
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-07-05T00:30:18.857Z
Answers.LastActivityDate: 2017-07-05T00:30:18.857Z
Answers.UserDisplayName: Brad Bell
Body: <p>I know Craft appends slugs with -1 if they already exist but I'm working on an app where the addition makes things awkward for us (we have to match the slug to a third-party service). I was under the impression they had to be unique but it seems you can edit an entry and change the slug to be the same as one that already exists.</p>
  
  <p>This could be a good workaround for us, but I want to check whether it's a bug that's likely to get squashed or deliberate behaviour.</p>
  
Tags: <entrymodel><slug><entry-slug>
Title: Do slugs absolutely have to be unique?
ThreadText: # Do slugs absolutely have to be unique?
  
  (Asked by: username_0 on 2017-07-04)
  
  I know Craft appends slugs with -1 if they already exist but I'm working on an app where the addition makes things awkward for us (we have to match the slug to a third-party service). I was under the impression they had to be unique but it seems you can edit an entry and change the slug to be the same as one that already exists.
  
  This could be a good workaround for us, but I want to check whether it's a bug that's likely to get squashed or deliberate behaviour.
  
  **Tags:** entrymodel, slug, entry-slug
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2017-07-05. Score: 1 | Accepted answer
  
  Technically it's a combination of the element's slug plus URI that is required to be unique (on a per-locale basis).
  
  You can see the logic used and where it's enforced at the code level in [`ElementHelper::setUniqueURI()`](https://github.com/pixelandtonic/Craft-Release/blob/master/app/helpers/ElementHelper.php#L74)
  
  > **Comments:**
  > **username_0**: Ah right, so this is expected behaviour in a Structure section then.  
  > **username_1**: Assuming the nested entries setting for that Structure is set to `{parent.uri}/{slug}`, then yeah, there's a good chance it'll always be unique (unless they're on the same level in the Structure).  
  > **username_0**: In our case that's what we need, so thank you.  
  
  ---
  
  