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

[enhancement] Compound slug #17

Closed christher-lenander closed 2 years ago

christher-lenander commented 2 years ago

Add an option in the plugin config where you could add fields to put togheter for a slug. Maybe an array with fieldnames. The order of they are in the array should be how the compund slug is made.

ComfortablyCoding commented 2 years ago

That sounds like a useful feature.

What would be the expected behaviour when one or more of the fields are not defined?

Current possible options

  1. If any of the fields are missing a value dont apply slugification, this is the current behaviour for the reference field.
  2. We skip any fields that are not defined and use the remaining for the slugification.
  3. Leave it up to the user with a setting. default would be to skip slugification.

I believe 3 is probably the best option as it provides the ability for the user to decide on which behaviour they prefer.

christher-lenander commented 2 years ago

I agree that 3 is the best.

ComfortablyCoding commented 2 years ago

This features has been added in #22 , and will be included in the next release.

christher-lenander commented 2 years ago

👍

NidMo commented 2 years ago

That sounds like a useful feature.

What would be the expected behaviour when one or more of the fields are not defined?

Current possible options

  1. If any of the fields are missing a value dont apply slugification, this is the current behaviour for the reference field.
  2. We skip any fields that are not defined and use the remaining for the slugification.
  3. Leave it up to the user with a setting. default would be to skip slugification.

I believe 3 is probably the best option as it provides the ability for the user to decide on which behaviour they prefer.

how can i skip slugification.

When the slugs automatically generated by the slugging are empty, can the slugs actively entered by the user not be overwritten

ComfortablyCoding commented 2 years ago

If all fields are missing or some are and skip is not true then it should already do this.

I will need to investigate this further.