Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dynamic Slugs Problem when Entry will duplicated #5668

Closed
davidhellmann opened this issue Feb 18, 2020 · 3 comments
Closed

Dynamic Slugs Problem when Entry will duplicated #5668

davidhellmann opened this issue Feb 18, 2020 · 3 comments

Comments

@davidhellmann
Copy link
Contributor

We have a project where we create most of the slugs dynamic.
Now the problem is when an Author duplicate an entry the slug is the same and does not change on save (add a -1 at the end)

With normal slugs the behaviour is fine. It adds a -1 at the end.

would be nice if dynamic slugs would be work the same.

Craft CMS: 3.1.17.2

@brandonkelly
Copy link
Member

What do you mean by “dynamic slugs”?

Craft will only increment the slug automatically (e.g. foo-1) if it is trying to give an entry a unique URI, and its URI format contains {slug}.

If your URI format doesn’t contain {slug}, then take a look at #4759, which is now fixed for the next release.

@davidhellmann
Copy link
Contributor Author

@brandonkelly ah sorry,

mean Dynamic Titles that creates the slug:
image

When I duplicate an Entry with an Title like this, it creates the same slug twice.

But maybe this issue above fix that problem

@brandonkelly
Copy link
Member

Yeah so to be clear, slugs will only be incremented when Craft is attempting to find a unique URI for the entry, and only if all of these things are true:

  • The section has an Entry URI Format.
  • The section’s Entry URI Format contains {slug}.
  • Another entry with the exact same URI already exists. (It doesn’t matter if another entry with the same slug already exists, unless that results in a duplicate URI.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants