Skip to content

Pages and templates ​

An assistant can also design where values appear: add blocks to a post, a template, a template part or a synced pattern, bind them to fields with dynamic tags, repeat them with data loops, and add visibility rules. For example: "on the single Book template, add a Contact heading and the phone number, and hide both when there's no phone".

How it works ​

The assistant never writes raw block markup. It describes the change as a list of steps (insert a heading here, bind this paragraph to phone, hide it when empty), and VX builds valid blocks from them. The result looks and behaves exactly like blocks you'd add by hand, and you can keep editing it in the block editor or Site Editor.

The whole list is checked and saved as one change: if any step fails, nothing is written. Before saving, VX checks for problems that would otherwise fail silently on the page, such as a binding to a field the post type doesn't have, a loop on a block that can't repeat, or a visibility rule type that doesn't exist, which would hide a block forever.

Blocks the assistant creates get a name, shown in the editor's List View, so both you and the assistant can refer to them later.

Previewing ​

An assistant can preview a page or template with every binding resolved against a real entry, to see what visitors would get before it saves.

Templates and themes ​

Templates and template parts need a block theme. With a classic theme, an assistant can still edit post content and synced patterns.

Undo ​

Each page or template change saves a WordPress revision first, and reports it as the undo. Post types without revisions, and templates that only existed in the theme's files before, have nothing to go back to; the assistant is told so.

Warning

A template is saved as a whole. If someone edits the same template in the Site Editor while an assistant is working on it, the later save replaces the earlier one completely. Ask the assistant to guard its change with what it read (it will be refused if the template changed), and avoid editing the same template at the same time.

Technical details for LLMs
  • Reads: vx-framework/get-block-catalog (block theme?, block-editor post types, meaningful template slugs, bindable/loopable blocks, the kit's buildable blocks, theme design tokens; start here), vx-framework/list-block-documents, vx-framework/get-block-document (addressable tree: path + name per block, bindings, loop, visibility, entity context, content_hash), vx-framework/preview-block-document (expressions resolved against a real entity), vx-framework/list-block-patterns (with bindable text slots), vx-framework/validate-block-document (full pipeline in memory; exposed by default).
  • Writes (opt-in): vx-framework/edit-block-document (kind: post | template | template_part | pattern; if_match = content_hash; ordered operations: insert, insert_pattern, update, replace, move, remove, bind, unbind, set_loop, set_visibility, rename; targets by path, name or anchor; all-or-nothing), vx-framework/set-block-document (wholesale replace; destructive), vx-framework/restore-content-revision (undo target).
  • Checks: binding on a non-bindable attribute, unknown field path, loop on a non-repeatable block, unknown visibility rule type (would hide forever), invalid markup; warnings for e.g. core/heading bound to the title where core/post-title exists, hardcoded colors with a theme preset, a binding inside a loop that ignores the loop, and nested loops over the same source.
  • Undo: restore_post_revision via vx-framework/restore-content-revision; none when the post type has no revisions or the template had no database copy.

Documentation for the VX Framework.