Editable slug field validation

  • Hello,

    Adding the editable attribute to a slug tag allows us to edit the slug:

    1. <perch:content id="name" type="text" label="Name" title required>
    2. <perch:content id="slug" type="slug" for="name" label="URL segment" editable>

    However, the field accepts non-URL friendly characters. It would be nice if the editor isn't able to enter any non-URL friendly characters in this case.

    I think it makes sense to have some front-end validation or input patterns/mask to ensure the editor only enters URL-safe slugs. One less thing for the editor to remember, one less thing for the developer to teach the editor and one less thing that can go wrong (broken URL).

    Even though I agree that if the site maintainer isn't tech-savvy enough to customise the URL slug, it's probably better for everyone not make the slug editable. However, some sites have more than one maintainer/editor (especially multi-lingual sites) and some may be more tech-savvy than others.