mattmilburn/strapi-plugin-permalinks

Internalization - it's not possible to have the same link for both languges.

Opened this issue · 5 comments

I would expect to able to set the same name for the link for other locales.

Current behavior:

  • add Page with slug - "contact". with default EN locale.
  • change current page to any other locale and set slug to - "contact" - error - unavailable.

For now managed to overcome by adding string as a type

 "slug": {
      "pluginOptions": {
        "i18n": {
          "localized": true
        }
      },
      "type": "string",
      "customField": "plugin::permalinks.permalink",
      "targetField": "title",
      "targetRelation": "parent",
      "required": true
    },

and aslo add unique constrain in db ALTER TABLE public.pages ADD CONSTRAINT pages UNIQUE (slug, locale)

Hi @nikkizol Thank you for raising this issue. I’ve been wondering if going forward the field type may change to a regular string type with all of the same uniqueness handling applied to it as a uid which may improve i18n support.

Glad you were able to patch it for now 🙂 you actually may be able to just use ”unique”: true on the slug attribute.

Hi @nikkizol Version 2.0.0 of this plugin is now released and has some improvements to localization features. There will also be more bug fixes and optimizations related to localizations in a future release.

Please review the migration guide before upgrading 🙂

Hi @mattmilburn, I start using V2.0.0 for a new project but now even if I set type "type": "string", it is still throwing error, also even if I remove localized property from the slug attribute....

Screenshot 2023-08-24 at 13 29 39

Warning:

Permalink value must be unique.

Hi @mattmilburn,

Can I check if there are any plans to support this?

Thank you!