Strapi plugin logo for Strapi Schema Extender

Strapi Schema Extender

A Strapi plugin to extend your content-type schemas with layout and metadata fields, enabling schema-driven control over the Strapi Content Manager UI.

Strapi Schema Extender

A Strapi plugin to extend your content-type schemas with layout and metadata fields, enabling schema-driven control over the Strapi Content Manager UI.


Features

  • Schema-driven layouts:
    Define field sizes, positions, and visibility directly in your schema for Content Manager edit views.
  • Schema-driven metadatas:
    Set field labels, descriptions, and other UI metadata in your schema.
  • Schema-driven Content Manager options:
    Set Content Manager settings (like mainField, defaultSortBy, etc.) and list columns directly in your schema.
  • Non-destructive:
    Only updates what you define in your schema—preserves manual admin UI changes.
  • Automatic merging:
    Deep merges your schema config with existing Content Manager settings.
  • Validation-safe:
    Only allowed keys and fields are updated, preventing Strapi validation errors.

Example Usage

Add layouts, metadatas, and a content-manager block to your content-type schema:

1{
2  "kind": "collectionType",
3  "collectionName": "pages",
4  "info": { "singularName": "page", "pluralName": "pages", "displayName": "Pagina" },
5  "options": { "draftAndPublish": true },
6  "pluginOptions": { "i18n": { "localized": true } },
7  "content-manager": {
8    "settings": {
9      "mainField": "id",
10      "defaultSortBy": "id",
11      "defaultSortOrder": "ASC"
12    },
13    "list": ["id", "title", "parent", "slug"]
14  },
15  "attributes": {
16    "title": {
17      "type": "string",
18      "required": true,
19      "layouts": {
20        "size": 12,
21        "position": 1
22      },
23      "metadatas": {
24        "label": "Naam",
25        "description": "De naam van het restaurant"
26      }
27    },
28    "parent": {
29      "type": "relation",
30      "relation": "oneToOne",
31      "target": "api::page.page",
32      "layouts": {
33        "size": 12,
34        "position": 0,
35        "hidden": true
36      },
37      "metadatas": {
38        "label": "Naam",
39        "description": "De naam van het restaurant"
40      }
41    }
42    // ... other attributes ...
43  }
44}

Note:
If you set "hidden": true in an attribute's layouts, that field will be excluded from the Content Manager edit view.
Remove "hidden": true to make the field visible again.


How it works

  • On Strapi bootstrap, the plugin:
    1. Fetches the current Content Manager configuration for each content type.
    2. Checks your schema for layouts and metadatas on each attribute.
    3. Checks for a top-level content-manager block for settings and list columns.
    4. Updates only the relevant parts of the configuration (size, position, label, description, settings, list, etc.).
    5. Deep merges changes, preserving all other settings and admin UI customizations.

Supported Layout Fields

  • size: Field width in the edit view (1–12).
  • position: Order of fields in the edit view (lower = earlier).
  • hidden: If true, the field will not appear in the edit view.

Supported Metadata Fields

  • label: Field label in the UI.
  • description: Field description/help text.
  • placeholder, visible, editable, mainField (for advanced use).

Supported Content Manager Options

  • settings:
    • mainField: Main field for relations/search.
    • defaultSortBy: Default sort column.
    • defaultSortOrder: Default sort order (ASC/DESC).
    • ...and any other Content Manager settings supported by Strapi.
  • list:
    • Array of field names to show as columns in the list view.

Why use this?

  • Centralize UI config in your schema files.
  • Automate layout and metadata for new environments or deployments.
  • Avoid manual UI tweaks after every deploy or schema change.
  • Full control over Content Manager list columns and settings from code.

Installation

  1. Run the npm install command npm install strapi-schema-extender
  2. Enable the plugin in your plugins.ts:
1 "strapi-schema-extender": {
2    "enabled": true,
3 }
  1. Add layouts, metadatas, and a content-manager block to your schema as shown above.
  2. Restart Strapi.

👏 Support My Work

Hey there! I'm actively maintaining this project on my free time, and if you've found it useful, I'd greatly appreciate your support. Donations will help cover hosting costs, tools, and allow me to dedicate additional time for updates, features, and bug fixes.

You can contribute by donating through this link:

Donate via PayPal

I’d be forever grateful for your generosity. Thank you for helping keep this project alive and growing! ❤️


License

MIT

Install now

npm install strapi-schema-extender

STATS

No GitHub star yet1 weekly download

Last updated

72 days ago

Strapi Version

5.21.0 and above

Author

github profile image for kwdtje
kwdtje

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.