Skip to content

Document pluginOptions in Models #2598

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

Merged
merged 4 commits into from
Jul 23, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 39 additions & 0 deletions docusaurus/docs/cms/backend-customization/models.md
Original file line number Diff line number Diff line change
Expand Up @@ -594,6 +594,45 @@ The `options` key is used to define specific behaviors and accepts the following
}
```

### Plugin options

`pluginOptions` is an optional object allowing plugins to store configuration for a model or a specific attribute.

| Key | Value | Description |
|---------------------------|-------------------------------|--------------------------------------------------------|
| `i18n` | `localized: true` | Enables localization. |
| `content-manager` | `visible: false` | Hides from Content Manager in the admin panel. |
| `content-type-builder` | `visible: false` | Hides from Content-type Builder in the admin panel. |

```json title="./src/api/[api-name]/content-types/[content-type-name]/schema.json"

{
"attributes": {
"name": {
"pluginOptions": {
"i18n": {
"localized": true
}
},
"type": "string",
"required": true
},
"slug": {
"pluginOptions": {
"i18n": {
"localized": true
}
},
"type": "uid",
"targetField": "name",
"required": true
}
// …additional attributes
}
}

```

## Lifecycle hooks

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`·
Expand Down
Loading