build_page
Create a WebCake storefront page with its full content source in one step. Preview via dry-run first, then save to publish.
Instructions
Create a brand-new page AND set its full content source in one step. Two-step safety: call with dry_run=true (default) to validate and preview, then dry_run=false to actually create + save. The source must be { sections: [...] } — build sections with new_section. Validation errors block the real save.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| seo | No | SEO for this page → settings.seo. Without it the page publishes with an EMPTY title/description. For a store page a good default title is '{{name_product}} | {{name_site}}' (product) or '{{name_category}} | {{name_site}}' (category). | |
| name | Yes | Page name | |
| slug | Yes | URL slug WITHOUT a leading slash, e.g. 'about', 'collections', 'cart'. A leading '/' is stripped automatically (the storefront matches the bare path segment, so '/cart' would 404). Store pages MUST use the conventional slugs: category='collections', product detail='products', cart='cart', checkout='checkout', thank-you='complete'. The homepage needs no slug (pass is_homepage:true). | |
| type | No | Page kind. SPECIAL pages need a site data-source enabled — build_page does this automatically: store→use_store (product/cart bindings), member→use_member (customer/order bindings), blog→use_blog, error→use_error, maintain→use_maintain. 'main'/'custom' need nothing. Omit for a normal content page (defaults to 'main' for the homepage). | |
| source | No | Full page source { sections: [...] } (object or JSON string) | |
| dry_run | No | Preview+validate only (true) or create+save (false) | |
| is_homepage | No | Set as the site homepage |