Users create an account and their profile (domain.com/userName) is a template pulling info from craft users.

Each user can create entries, all stored in a Structure section (domain.com/userName/entrySlug).

Problem is when different users have an entry with the same title, entrySlug can become entrySlug-1 etc. Although the URL is unique, the slug obviously can't be with entries in the same structure.

But I cannot think how to set this up. A structure per user seems overkill.


  • Are you using a custom route to resolve domain.com/userName/entrySlug?
    – Oli
    Apr 30 '20 at 11:49
  • @Oli Yea entry URI format {author.username}/{slug}
    – Rich Holt
    Apr 30 '20 at 12:36
  • That's odd, when I try locally, I'm not getting duplicate slugs. Which version of Craft are you on? Are your users creating entries via the Control Panel or a front-end entry form?
    – Oli
    Apr 30 '20 at 12:52
  • That's the problem - not getting duplicate slugs. Say I have user1 and user2, they both might create an entry with the same title. So one of those users will get an entry slug of entrySlug-1. Would like entry slugs to be unique to the user, not all users.
    – Rich Holt
    Apr 30 '20 at 13:01
  • Again, I'm not seeing the same thing as you. User A creates entry about, URI is userA/about, if user B creates an about entry, URI is userB/about. Now if user A creates another about entry, then the URI is userA/about-1. Are you testing via the Control Panel?
    – Oli
    Apr 30 '20 at 13:20

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.