-
-
Notifications
You must be signed in to change notification settings - Fork 27
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Programmatically disabled the plugin if user provides a custom slug #56
Comments
This is an interesting request, thank you for your interest. My first thoughts are that you could probably disable Let me know if that would be an option and I will think of other ways to solve this use case. |
Hi, @jarrodconnolly and thanks for the quick reply. Let me describe the use-case, as I believe for people who want to support custom slugs, like e.g. WordPress does, would want this same behaviour.
The reason why overwrite property isn't sufficient is due to the edge-case. If we would set the overwrite to false, the slug would never be regenerated, and this is fine in the context of the custom slugs. If the custom slug, we indeed don't want the plugin to do anything. Whatsoever, slug is sometimes going to be custom, sometimes not. Sometimes a user might have a custom slug, and then at one point decide to remove it. In my opinion, I don't think this will be possible without introducing some additional property, either that user has to send through the actual request object or something through the default plugin configuration object. This is because there would be no way for this plugin right now to figure out if something is custom or not. Let me know if you have any ideas, I'm more then happy to help. |
Trying out an idea for this logic here: Edit to add more precise detail to the change: Take a look at that diff or test that branch if possible. Let me know if this works for your use case or if something is still missing. Thanks! |
Hey guys, and thanks for building the plugin. I was wondering if there's a way to programmatically disable
sequelize-slugify if the user provide a custom slug.
Basically, I have a use-case where users are allowed to create their own custom slugs, e.g. for articles, and if one is provided, I would like this plugin to simply do nothing.
Is there a way to do this now, and if not, how can we help to implement this feature? I don't mind fiddling with the plugin and doing a PR.
Cheers
The text was updated successfully, but these errors were encountered: