Adds Dynamic Zone clipboard actions for the sections field in Content Manager.
- In Content Manager edit view, the
sectionsfield shows a clipboard icon near the label. - Open the clipboard panel to copy a block or paste it (replace/insert/append).
Clipboard storage key:
content-copy:clipboard
Payload shape:
{
kind: "dz-block",
component: "blocks.hero-main",
data: { ... },
ts: 1730000000000,
source: {
uid: "api::page.page",
entryId: "documentId-or-id",
field: "sections",
index: 0
}
}
{
"uid": "api::page.page",
"entryId": "documentId-or-id",
"field": "sections",
"operation": "replace",
"index": 0,
"locale": "en",
"clipboard": {
"kind": "dz-block",
"component": "blocks.404",
"data": {
"title": "Pasted"
},
"ts": 1730000000000,
"source": {
"uid": "api::page.page",
"entryId": "documentId-or-id",
"field": "sections",
"index": 0
}
}
}
Response:
{
"data": {
"uid": "api::page.page",
"entryId": "documentId-or-id",
"field": "sections",
"locale": "en",
"sections": [ ... ]
}
}
Same payload as /dz/apply, but does not persist changes. Returns the computed sections array.
From the target project backend/:
git subtree add --prefix=src/plugins/content-copy git@github.com:YOUR_USER/content-copy-plugin.git main --squash
Copy src/plugins/content-copy into the target project at the same path.
Update config/plugins.js:
'content-copy': {
enabled: true,
resolve: './src/plugins/content-copy',
},
Run:
npm run build
- Only the
sectionsdynamic zone is supported. - Clipboard data is normalized on copy (system keys removed, media objects to IDs).
- For i18n, pass
localeto target the active locale.