Skip to content

Commit 389d313

Browse files
Merge pull request #2598 from strapi/cms/pluginOptions
Document pluginOptions in Models
2 parents daf4269 + eb5b740 commit 389d313

File tree

1 file changed

+39
-0
lines changed
  • docusaurus/docs/cms/backend-customization

1 file changed

+39
-0
lines changed

docusaurus/docs/cms/backend-customization/models.md

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -594,6 +594,45 @@ The `options` key is used to define specific behaviors and accepts the following
594594
}
595595
```
596596

597+
### Plugin options
598+
599+
`pluginOptions` is an optional object allowing plugins to store configuration for a model or a specific attribute.
600+
601+
| Key | Value | Description |
602+
|---------------------------|-------------------------------|--------------------------------------------------------|
603+
| `i18n` | `localized: true` | Enables localization. |
604+
| `content-manager` | `visible: false` | Hides from Content Manager in the admin panel. |
605+
| `content-type-builder` | `visible: false` | Hides from Content-type Builder in the admin panel. |
606+
607+
```json title="./src/api/[api-name]/content-types/[content-type-name]/schema.json"
608+
609+
{
610+
"attributes": {
611+
"name": {
612+
"pluginOptions": {
613+
"i18n": {
614+
"localized": true
615+
}
616+
},
617+
"type": "string",
618+
"required": true
619+
},
620+
"slug": {
621+
"pluginOptions": {
622+
"i18n": {
623+
"localized": true
624+
}
625+
},
626+
"type": "uid",
627+
"targetField": "name",
628+
"required": true
629+
}
630+
// …additional attributes
631+
}
632+
}
633+
634+
```
635+
597636
## Lifecycle hooks
598637

599638
Lifecycle hooks are functions that get triggered when Strapi queries are called. They are triggered automatically when managing content through the administration panel or when developing custom code using `queries`·

0 commit comments

Comments
 (0)