strapi-plugin-dynamic-zone-tools
v1.0.0
Published
Dynamic zone productivity tools for Strapi 5: copy dynamic zones from other records and duplicate, copy, or insert individual component blocks.
Maintainers
Readme
Strapi Dynamic Zone Tools Plugin
A productivity plugin for Strapi 5 that makes dynamic zones faster to work with in the Content Manager.
Copy full page sections from another entry, append selected blocks, duplicate existing blocks, or copy and insert individual components without leaving the edit view. It is especially useful for page builders, landing pages, reusable content sections, campaign pages, and any Strapi setup where editors work with large dynamic zones.
⚠️ Version Compatibility
- v1.x: Supports Strapi v5.41.0 and newer
✨ Features
- 🎯 Copy Dynamic Zones Between Entries: Fill a dynamic zone from another record in the Content Manager
- ➕ Replace or Append Modes: Replace the current zone or append selected blocks to the end
- ✅ Block-Level Selection: Choose exactly which source blocks should be copied
- 🧩 Duplicate Individual Blocks: Duplicate a dynamic zone component directly in the current entry
- 📋 Copy and Insert Blocks: Copy a block and paste it above or below another compatible block
- 🛡️ Schema-Aware Copying: Automatically skips components that are not allowed in the target dynamic zone
- 🔗 Nested Data Support: Preserves nested components, media, and relation references when preparing copied data
- 🌍 i18n and Draft/Publish Aware: Works with localized content and draft or published source records
- 🔐 Permission-Protected Source Fetching: Protects the source-document lookup endpoint with a dedicated admin permission
- ✍️ No Auto-Save: Applies changes to the form only, so editors can review before saving
🚀 Installation
Using npm
npm install strapi-plugin-dynamic-zone-toolsUsing yarn
yarn add strapi-plugin-dynamic-zone-tools⚙️ Configuration
Enable the plugin in config/plugins.js:
module.exports = {
"dynamic-zone-tools": {
enabled: true,
},
};For TypeScript projects, use config/plugins.ts:
export default {
"dynamic-zone-tools": {
enabled: true,
},
};After installation, rebuild and restart Strapi:
npm run build
npm run develop🔧 Setup
- Install and enable the plugin.
- Rebuild and restart your Strapi application.
- Go to Settings -> Roles.
- Select the role that should use the plugin.
- Under Plugins -> Dynamic Zone Tools, enable Fill Dynamic Zone.
- Save the role.
The fill-from-record workflow uses this permission for its source-document lookup. Inline duplicate/copy/insert actions run inside the Content Manager form and are ultimately governed by the editor's normal Content Manager save permissions.
🎯 Usage
Copy a dynamic zone from another record
Use this when an editor wants to reuse an existing page layout, campaign structure, FAQ section, landing page blocks, or any dynamic zone content from another entry.
- Open a Content Manager entry that has at least one dynamic zone field.
- Click the Copy dynamic zone data header action.
- Select the target dynamic zone in the current entry.
- Choose Replace current zone or Append to current zone.
- Select the source collection type.
- Select the source dynamic zone field.
- Select the source record.
- If relevant, choose the source locale and draft/published version.
- Select the source blocks you want to copy.
- Confirm the action, review the edited form, and save when ready.
When copying between different dynamic zones, components that are not allowed by the target schema are skipped automatically.
Duplicate, copy, or insert individual blocks
Use this when an editor wants to quickly create a similar section inside the same entry or move a reusable block pattern into another compatible dynamic zone.
- Open a Content Manager entry with a dynamic zone.
- Use the block row actions inside the dynamic zone field.
- Click Duplicate component to duplicate the current block.
- Click Copy block to copy a block.
- Use Insert on another block row to paste the copied block above or below.
- Save the entry when the form looks correct.
Copied blocks can only be inserted into compatible dynamic zones.
🔐 Permissions
The plugin uses Strapi's admin role permission system for source-document lookup.
| Permission | Description |
| --- | --- |
| Fill Dynamic Zone | Allows users to fetch source document data for the fill-from-record workflow. |
Current behavior:
- The fill-from-record workflow calls the plugin admin API, so it requires an authenticated admin user with the Fill Dynamic Zone permission.
- The duplicate/copy/insert block actions are client-side Content Manager form actions. They do not call the plugin API; the resulting changes are saved only if the user has normal Content Manager permissions to save the entry.
🔌 API Endpoint
The plugin uses an admin-authenticated endpoint for source document lookup:
| Method | Endpoint | Description |
| --- | --- | --- |
| GET | /dynamic-zone-tools/source-document/:contentType/:id | Fetch a source record with deeply populated dynamic zone data. |
This endpoint is intended for the plugin UI, not for public API access. Content type and record list data is read through Strapi's authenticated Content Manager APIs.
🧠 How It Handles Copied Data
Dynamic zones can contain nested components, media fields, relations, localized content, and draft/published versions. The plugin prepares copied data before inserting it into the edit form:
- Removes transient identifiers that should not be reused in a new block
- Preserves component structure and allowed relation references
- Filters out component types that are not allowed by the target dynamic zone
- Keeps changes in the unsaved form state until the editor saves the entry
🛠️ Troubleshooting
Plugin action is not visible
- Confirm the content type has at least one dynamic zone field.
- Confirm your admin role has the Fill Dynamic Zone permission.
- Rebuild and restart Strapi after installing or changing plugin configuration.
A copied block is skipped or cannot be pasted
The block's component type is probably not allowed in the target dynamic zone. Update the target dynamic zone schema or copy into a compatible field.
Source records are missing
Check whether the source content type uses draft/publish or i18n. The plugin scopes source records by the selected version and locale.
🧑💻 Development
From the plugin directory:
npm run build
npm run verify
npm run test:ts:front
npm run test:ts:backFor local Strapi testing, enable the plugin with resolve in the parent Strapi application, then run the parent app build/develop commands.
📦 Package Contents
The npm package includes:
- Built admin and server output in
dist/ - Source folders used by Strapi plugin development workflows
strapi-admin.jsandstrapi-server.jsentry files- README, changelog, contributing guide, and license
🤝 Contributing
Issues and pull requests are welcome. Please include your Strapi version, reproduction steps, and any relevant content type schema details.
📄 License
MIT
