Forum

Thread tagged as: Suggestions

Option to prevent duplicate slugs

I would love an option for the slug field type that would check for existing duplicate slugs, and add a number to the end of the slug if a duplicate exists, similar to the way Wordpress handles pages with the same name.

For example, if I have:

<perch:content id="title" type="text" label="Title" />
<perch:content id="slug" type="slug" for="title" />

and an editor creates two items with the same title, they get the same slug. Of course, I can set editable="true" and explain to the editor in help="" that slugs need to be unique, but they may forget (as has happened to me multiple times).

It would be great if there were an option like prevent-duplicates="true", so if two pages have a title of "This Is The Page Title", the first slug would be 'this-is-the-page-title' and the second would be 'this-is-the-page-title-2'.

Shane Lenzen

Shane Lenzen 18 points

  • 6 years ago
Drew McLellan

Drew McLellan 2638 points
Perch Support

Yes, I think that would be useful.