locale-slug
v1.0.1
Published
A plugin that lets you use slug field with i18n, by forcing your slug field to follow the template `${locale}_${code}`.
Downloads
3
Readme
Strapi plugin locale-slug
A plugin that lets you use slug field with i18n, by forcing your slug field to follow the template ${locale}_${code}
.
Installation
yarn add locale-slug
yarn build
Guide
- Add custom field locale-slug to your collection type.
- For name field you can set any you want (in my example it'll be
code
) - For Slug field enter name of existing slug field (in my case it'll be
slug
) - Go to advanced settings tab and disable localization
- Optional. Configure the view to hide slug field
Now you have a field that will act like UID field (but it actually simple text field). On save it will modify your slug field to follow the template ${locale}_${code}
.
Warning
Don't try to search your entity by that field, it's bad for performance. Search by your original slug field.