0

I would like to set mandatory url naming conventions for custom content type nodes.

When users create a new content type I want to force certain naming conventions for the url alias. For example:

when creating 'Type A' and 'Type B' pages they should have aliases of the form:

  • www.example.com/a/{user-assigned} (Type A)
  • www.example.com/b/{user-assigned} (Type B)

is there a way to do this in Drupal 8?

1

Yes, this use case is covered under the Pathauto module.

Essentially, you'll add a new Content patterns (from the admin UI in admin/config/search/path/patterns) for each of your content types with the following path pattern, my_type/[node:author:account-name].

As long as the user doesn't have the Administer URL aliases & Create and edit URL aliases permissions, their created content path will be set automatically without being able to change the path.

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.