✔ A custom field for Strapi that allows users to select multiple options from a predefined list.
翻译准备中
取自仓库 README
正在加载完整 README。
查看完整 README ↗A custom field for Strapi that allows users to select multiple options from a predefined list.
Install with NPM.
npm install strapi-plugin-multiselect-field --save
Install with Yarn.
yarn add strapi-plugin-multiselect-field
Add the following configuration to your config/plugins.ts file. Create the file if it doesn’t already exist:
export default {
// …
'multiselect-field': {
enabled: true,
},
};
Then restart the app to apply the changes.
After installation, the "Multiselect" field will appear in the Custom Fields section of the Content-Type Builder.
To define available options:
Note: Removing an option doesn't change existing entries. Options that are still selected are shown in the edit view marked as (no longer available), so they can be unselected.
You can specify a custom delimiter for storing the selected values in the database.
, the API response will look like:Option-1,Option-2,Option-3.Note: The selected values are stored as a plain string, so you can filter entries by any selected option when viewing data in the list view in the admin panel.
Below are screenshots from an example application where this plugin is used to select available product sizes.