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

feat: add locale param option for gql #50

Open gregghawes opened 2 years ago

gregghawes commented 2 years ago

When translating my categories, quite a few are the same across different languages.

Would it be possible to have an option to allow duplicated slugs and a "locale" option in the findSlug graphql method?

ComfortablyCoding commented 2 years ago

If you set the slug field localization to disabled it should have the same value for all locales.

I will look into adding the locale param for gql. PRs are always welcome :)

alexcho267 commented 2 years ago

Curious if there's been any movement on this or if anyone's found a solution. Cheers!

ComfortablyCoding commented 2 years ago

No progress on it atm, I haven't had a chance to look into this yet.

Need to research on how we can check if i18n are enabled and content is localized.

Naive way would be to check if the plugin is installed but don't believe that's a guarantee.

alexcho267 commented 2 years ago

Is there a way to use the pattern outlined here for GraphQL?

ComfortablyCoding commented 1 year ago

No, not in gql.

The problem with gql is that it's not so easy to do things dynamically due to the schema.

For example in this case, their is no way for me to dynamically define the locale param as being valid for one content type but not another. With REST I don't need to do any of that.

I will see if their is someway to incorporate the already existing filter support for the generated type but will need some investigation.

I already started work on it on the feat-gql-add-locale-support branch but it would be for all content types so not ideal.

mpetito-envative commented 1 month ago

@ComfortablyCoding it would be useful if this could be supported, even if it's entirely opt-in at the plugin configuration level. What would help move this forward?

ComfortablyCoding commented 1 month ago

Hello @mpetito-envative ,

I am unfortunately no longer maintaining this plugin nor do I have the permissions to merge/push changes any longer.

A maintainer would need to take this over and implement as needed, if anyone is interested in maintaining this plugin please contact @derrickmehaffy