strapi-community / strapi-plugin-slugify

A plugin for Strapi Headless CMS that provides the ability to auto slugify a field for any content type.
https://market.strapi.io/plugins/strapi-plugin-slugify
MIT License
45 stars 21 forks source link

When I use I18N, how should I use Slugify #63

Closed NidMo closed 1 year ago

NidMo commented 2 years ago

I have content type.

image

The slug filed must be unique.But in different language environments, some words are spelled the same.

For example, the spelling of English marketing is the same as that of German marketing. In this case, the slug should be the same, but the rules restrict that the slug can only be a unique value

NidMo commented 2 years ago

Slugification Any time the respective content types have an entity created or updated the slug field defined in the settings will be auto generated based on the provided reference field.

When I input some Thai and Japanese text content, the automatically generated slug is empty. And the slugs I actively input will be overwritten by the automatically generated rules

ComfortablyCoding commented 2 years ago

Their is no unique restriction in place for slugs at this time. Two records can have the same slug.

In regards to the different language coming up empty I will need to look into this.

NidMo commented 2 years ago

Can I use a button to control whether to automatically generate a slug

ComfortablyCoding commented 2 years ago

At the moment no, it's not possible to disable the slugification for a specific record on save due to how the plugin is built.

It can potentially be added once custom fields are released but we will need to wait and see how those will operate.

I do plan on doing a revamp of the plugin and adding new features. I will keep this in mind.

ComfortablyCoding commented 1 year ago

I am closing this as it seems to me that ths is not something the plugin can handle by itself. I would suggest 2 possible solutions to anyone else having this issue

  1. Use an additional reference to make it unique per record and per internationalization (id and/or locale should ensure this)
  2. Use a text field over the uid field for the slug to get around the unique constraint.