Save synced pattern
fabrement-save-synced-patternCreate a GLOBAL BLOCK (synced pattern) from deployed blocks, or change one by patternId — every page placing it changes with it. mode is REQUIRED and has no default: create (new pattern, no patternId) · replace (the body becomes exactly blocks) · edit (change part of it through edits). blocks[] as in save-content ({name, attributes} or {markup}); must hold at least one Fabrement block. Change part of an existing one with mode "edit" + edits + expectedHash from get-synced-pattern. Place it on a page with save-content {name:"core/block", attributes:{ref: patternId}}.
Rules: get-skill-doc {id:"synced-pattern-contract"} — read it before the first call.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| kind | No | header / footer: a template's frame (save-template headerPatternId), filed under that pattern category. section (default on create): placed on pages. Omit on update to keep. | |
| mode | Yes | Required — there is no default. create: a NEW pattern; patternId must be absent. replace: the body of that pattern becomes exactly `blocks`. edit: change part of it through `edits`, without re-sending every block. | |
| edits | No | mode "edit" only. Applied in order to the body get-content returned; all or none. | |
| title | No | Required on create; the name admins pick it by. | |
| blocks | No | The whole body (create, or replace an existing one). | |
| patternId | No | Omit to create. | |
| allowForeign | No | Change a pattern that also holds blocks of a theme or another plugin (`foreign`). | |
| expectedHash | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| kind | No | header / footer (placed by templates) or section (placed on pages). | |
| title | Yes | ||
| blocks | Yes | ||
| usedBy | Yes | Records this change reached. | |
| created | No | ||
| editUrl | No | ||
| patternId | Yes | ||
| placement | No | The markup that places it. |