Higher Quality, Stronger Performance, Increased Stability, Better Developer Experience, discover everything we've shipped recently!

Strapi plugin logo for strapi-plugin-multi-enum-select

strapi-plugin-multi-enum-select

A strapi custom field for selecting multiple Enum options from a provided list of items

thumbnail for strapi-plugin-multi-enum-select

Strapi plugin multi-enum-select

A strapi custom field for selecting multiple Enum options from a provided list of items

multi-enum-select screenshot

Installation

To install this plugin, you need to add an NPM dependency to your Strapi application:

# Using Yarn
yarn add strapi-plugin-multi-enum-select

# Or using NPM
npm install strapi-plugin-multi-enum-select

Then, you'll need to build your admin panel:

# Using Yarn
yarn build

# Or using NPM
npm run build

Usage

After installation you will find the multi-enum-select at the custom fields section of the content-type builder.

multi-enum-select screenshot

You add options to the multi-enum-select by adding a line separated list of options to the options field.

You can also add a value and a label separated by a colon (e.g. label:value). If no value is provided, the label will be used as the value.

multi-enum-select screenshot options

then you can select one or more options from the list.

multi-enum-select screenshot

in this case the API will return

{
  "data": {
    "id": 1,
    "stuff": "Banana,citron"
  }
}

where you can filter it with $eq or $contains or .etc

and you can parse it with:

const values = stuff.split(',');

Delimiter

You can configure which character is used to separate the stored values. The delimiter is set per field in the Base settings tab of the content-type builder.

Available options:

LabelCharacter
Comma , (default),
Semicolon ;;
Pipe \|\|
Slash //
Dash --

When a non-default delimiter is configured the API response will reflect it:

{
  "data": {
    "id": 1,
    "stuff": "Banana;citron"
  }
}

Parse it on the client with the matching delimiter:

const delimiter = ';'; // match what you set in the field settings
const values = stuff.split(delimiter);

Note: If you change the delimiter on an existing field, previously stored values will not be migrated automatically. Make sure to update your stored data accordingly.

why it's better than the original plugin

1- string types are faster for data retrieving ond have hiegher performance

2- now you can filter the results with the fields you've created

3- so simple to sanitize the data to array again


Thanks for installing

here is the original plugin: https://github.com/Zaydme/strapi-plugin-multi-select


You can also check the multi-country-select plugin

Install now

npm install strapi-plugin-multi-enum-select

STATS

No GitHub star yet27 weekly downloads

Last updated

9 days ago

Strapi Version

5.47.0 and above

Author

github profile image for Sheryoo
Sheryoo

Useful links

Create your own plugin

Check out the available plugin resources that will help you to develop your plugin or provider and get it listed on the marketplace.