HOC SiteDocumentation

Data requests

Named dataRequests on page, page-component, header, and footer root.props own list/get/create/update behavior. Buttons and InteractiveWrapper only trigger a named request. VariableInputBlock edits variables that requests read and write. List UIs repeat rows with VariableArrayTemplateBlock bound to an entry[]/array variable.

Mental model

Queries decide what they do. A request carries op, objectTypeId, args (filters, searchQuery, fieldValues — often with {{var:id}} or {{bind:route.*}} tokens), an explicit select, reverse include lists, and optional resultWrites that copy results into editor variables after a successful run. Blocks bound to requests.<name> do not need a write. Button and InteractiveWrapper only set action to runRequest or runMutation plus requestName (optional include alias, loadingText/successText/errorText). Do not put search or submit logic on the button itself.

Where tokens resolve

{{var:…}} and {{bind:…}} (including {{bind:requests.<name>.results.<field>}}) are substituted wherever a string prop is resolved for paint — block text and HTML attribute values on allowed markup. Values are inserted as text: a multiline field keeps its newlines (use white-space:pre-line when you want them visible), and rich HTML stored in a field is escaped text, not markup. Rich text HTML is sanitized: <script> / <style> hosts and non-typography style declarations are stripped, so do not inject CSS or background-image workarounds into TipTap HTML. Shell decoration leaves (shell.background, shell.box, and the rest of shell.*) do not accept bindings today — for per-entry imagery prefer a bound SingleImage (or similar) rather than raw HTML CSS.

Placement

Pages read content.root.props.dataRequests and content.root.props.variables. Page components also read content.root.props.inputSchema. Headers and footers read content.root.props.dataRequests and content.root.props.variables only (no ticker variables, rules, or inputSchema). Email reads none of these. A page runRequest whose name matches a header or footer request refreshes that chrome request. dataRequests are stored per content locale. A locale that has no saved copy uses the primary locale's requests. {{bind:locale}} is that content locale code (for example en-US). {{bind:lang}} is en or tr for payment pages. The server sets both and ignores a page-supplied value. Host pages map component inputs with ComponentBlock.props.inputMappings ({inputId, source}). Top-level content.dataRequests, root.dataRequests (sibling of props), kind/operation/mappings/variables at the wrong level, and guessed shapes are stored verbatim but ignored by detailed mode and runtime — get_design_warnings flags them.

Schema

dataRequests[]: { name, op: list|get|create|update, objectTypeId, args?, select?, include?, resultWrites?, aggregate? }. aggregate on a list is { op: sum|count|min|max, field?, as? } over the filtered rows, not the current page. sum, min, and max need a number field or a calculated field with resultType number. count with no field counts rows; count with a field counts non-null values. as is the key under aggregates, read as {{bind:requests.name.aggregates.sum}}. With no as, the key is the field name, such as aggregates.quantity. When the summed field's select entry uses format number, aggregates[as] uses that currency and fraction-digit format. A bad op or field warns at save. Payload leaves on args (and on filter/include/resultWrite scalars such as value, limit, pathParam, sortBy, source) are Authored lists only: [{ if: "*", is: "{{bind:route.slug}}" }] or conditional branches with { bp } / other if clauses — bare strings or numbers are invalid, dropped at parse, flagged by get_design_warnings, and rejected on save. args keys: entryId, pathParam, filters, sortBy, sortDirection, thenBy, thenDirection, limit, page, offset, excludeRouteEntry, searchQuery, searchFieldKeys, fieldValues. sortDir is an alias of sortDirection and thenDir is an alias of thenDirection on args, include, fallback, and resultWrites. filters[]: { fieldKey, operator, value?, valueFromField?, whenEmpty? }. A filter value may be {{var:id}} inside an Authored leaf. When that variable is blank, whenEmpty no-filter (default) drops the filter and no-results returns no rows. select lists every field to return, including relation keys and dotted forward paths (category.name); each hop is a relation and the last segment is a field. A dotted entry such as order.price may use format number with an ISO currency code. {{bind:…}} prints that formatted string. A literal currency symbol next to currency repeats the symbol. A missing or empty select returns no field values. include.select follows the same rule. include[] loads reverse relations: { as, from, via, filters?, sortBy?, sortDirection?, limit?, select?, include?, rerun? }. from is the related type slug, via is its relation_object aimed at the parent, as is the result key. Nested include stops at NAMED_DATA_REQUEST_MAX_DEPTH (3). rerun include-only (default when omitted) re-fetches that include when only its variables change; request re-runs the parent. A variable used only inside an include re-fetches that include. The parent result and other includes keep the same objects, and the parent loading flag stays clear. resultWrites[]: { variableId, source?, distinct?, sortBy?, sortDirection?, orderFrom?, defaultVariableId? }. Writes are optional and only copy into variables. source defaults to results and may be total, hasMore, page, or pageCount. It also supports results[].field and include paths such as images[].size (entry fields are read from fieldValues). results.0.field copies the first row's field into a text variable. results.field does not read a field from the results array. results[].field is the projected list, not a single string. distinct keeps unique scalar values. sortBy value or a field key orders them; orderFrom is a parent field path (array or multiline) that wins, and values missing from it stay after in sort order. defaultVariableId sets that variable to the first written value when it is empty. Mapping source requests.<name>.results.<as> reads an include. inputSchema[] (components): { id, name, type: string|number|boolean|image|richText|entry|entry[] }. Tokens: {{var:id}}, {{bind:route.*}}, {{bind:query.*}}, {{bind:locale}}, {{bind:lang}}. Text fields and component inputs insert this page's query fields, variables, and URL params as chips. List rows: VariableArrayTemplateBlock.arrayBinding = {{var:hits}} (or {{var:items}}); slot uses {{var:item.<fieldKey>}}. A whole-value {{bind:requests.<name>.results}} is also accepted on VariableArrayTemplateBlock and SlotSliderBlock; each row is flattened so {{var:item.<fieldKey>}} still works. itemFilter on that block filters the bound array in the client before minItems; whenEmpty follows the same rule. An empty filtered list can render the emptyContent slot. Those variable ids are clientDependencies on detailed views, not request dependencies. Button runRequest may set include to an alias to re-fetch only that include. A select entry is a field key or { field, format?: "html"|"excerpt", maxChars?, suffix? }. A string, and format excerpt, return a plain excerpt (maxChars overrides 160, suffix defaults to …). format html leaves that field's stored HTML. format date accepts style short, medium, or long, or a pattern such as dd/MM/yyyy (pattern wins). The value is formatted in the content locale, so {{var:item.date}} shows that text. args.page is 1-based; args.offset wins when both are set and page becomes (page - 1) * limit. List results include total, hasMore, the resolved 1-based page, and pageCount (ceil(total / limit), at least 1). Bind {{bind:requests.<name>.total}}, {{bind:requests.<name>.hasMore}}, {{bind:requests.<name>.page}}, and {{bind:requests.<name>.pageCount}}. URL params stay on {{bind:query.*}}. A direct load honors ?page= on first render through {{bind:query.page}}. Filter operator overlaps matches any shared id on a multi relation_object. valueFromRoute "$id" or "id" is the route entry id. Any other valueFromRoute uses that URL param when it is present (slug on /urun/[slug]); otherwise it is relation ids from that field on the route entry. Omitting searchFieldKeys while searchQuery is set searches text, email, phone, multilineText, url, and enum fields. Filter operator contains matches text in that field. A top-level variable syncs to the URL when syncUrl is true. The query parameter is the variable name: the public page seeds it from that key, including the server render, and writes changes back with replaceState (page 1 is omitted). An older syncQueryKey still turns sync on, but the parameter is the name, not the old key. When another synced variable changes, paging variables (the variable named page, or any variable referenced by a list args.page) and the raw page query key reset to 1. Number updateVariables ops add and subtract clamp to 1…pageCount. A page past pageCount clamps the request to the last page. When args.page is {{var:id}} and offset is omitted, that variable is set to the clamped page. An explicit args.offset is left as requested. args.excludeRouteEntry drops the route entry id. args.fallback { sortBy, sortDirection } fills up to limit when the filtered rows are short, skipping ids already returned and the route entry. Button actions requestNextPage and requestPrevPage name the request and a query key (default page), write the next or previous page into that URL query, and re-run the request. requestPrevPage is disabled on page 1. requestNextPage is disabled when page is the last page (page >= pageCount). Lists that use valueFromRoute or excludeRouteEntry are cached per route id and slug, and their result writes are in the server HTML for both page and component requests. InteractiveWrapper urls resolve {{var:}} and {{bind:}} the same way Button does. args.thenBy and args.thenDirection append a second sort; omit them to keep the primary sort only. Bind the page with {{bind:query.page}}. VariableInputBlock labelGap is the label-to-control gap in px; omit it to keep the stylesheet. When documentId is omitted, the sample id is a live page that still has a public route. {{bind:session.id}} is the httpOnly website session. The server sets it; a value sent from the page is ignored. {{bind:user.id}}, {{bind:user.email}}, {{bind:user.roleLabel}}, and {{bind:user.entryId}} are the signed-in website visitor. The server sets them and ignores a page-supplied user binding. When nobody is signed in, user is absent. {{bind:user.id}} is the website user id in the access token (websiteUserId). {{bind:user.entryId}} is the member object entry id. They are different ids. These tokens also resolve in block text for the signed-in visitor. see_own matches entries this member created (created_by_website_user_id equals {{bind:user.id}}). Self-registration sets that column, so a list filter id = {{bind:user.entryId}} returns that member when the role has see_own on the user type. A filter does not widen that grant. id = {{bind:user.entryId}} with whenEmpty: no-results returns no rows when the bind is blank, and still returns no rows when see_own does not match the entry. A signed-in visitor is approved and not blocked. email_verified does not block sign-in. Registration assigns a role: the user-type role field default, otherwise the role labeled user, otherwise the oldest role. assign_user_role only changes that role and is not required to be signed in. {{bind:session.id}} stays the guest cookie. Guest identity is a site variable the author declares ({{var:name}}), not a field the server stamps. A site variable may live in an httpOnly cookie named hoc_site_<name> (SameSite=lax; maxAge is ttlSeconds, or 400 days). The server fills {{var:name}} from that cookie when it runs the saved request, and a posted value cannot replace it. When a surface variable uses the same name, {{var:name}} is the surface value and {{var:site.name}} is the site value. {{bind:session.id}} remains the website session cookie used for sign-in. sessionOwned no longer stamps that cookie into a field, and an update may change or clear the field. A type that still marks fields sessionOwned keeps the anonymous list filter: those fields must equal {{bind:session.id}}. Prefer a site variable and a normal filter. Anonymous responses still omit sessionOwned field values. Public slug, name, and label skip those fields. A list of a session-owned type is not a public_list_hidden warning. A filter fieldKey id matches the entry id. Any other unknown fieldKey matches no rows and get_design_warnings reports it. sortBy createdAt is the created_at column, and mutatedAt is mutated_at. Anonymous create and update run the saved request for that page or page component and name. The browser may send variable values, the honeypot, and formStartedAt. A name that is not a saved create or update is rejected. Tokens in the saved args still resolve. List and get run the request stored on the page. Public field write grants are the write boundary, and list/get results drop fields the viewer cannot read, the same way object displays do. A create may include args.children: [{ objectTypeId, fieldValues, linkField }]. Children are inserted in the same transaction. linkField must be a relation to the new parent and is stamped even when visitors cannot write it. Child entry_created runs, then the parent's, so a payment initialize sees the lines. {{var:sel.0.price}} reads fieldValues when price is not a direct property; a direct property still wins. Button action.type is read as action.kind when kind is absent.

Select options (VariableInputBlock)

Select options come from the editor variable, not from block props. Use type: "list" with options: [{ id, label }, …]. Alias type: "options" is accepted as list. Option entries may use value instead of id. Pair with VariableInputBlock control: "select" (or auto).

Public create

Public create applies only while the visitor is anonymous. Unconditioned public view_all is also anonymous-only. Conditioned public view_all (for example cookie / site-variable guest ownership) still applies after sign-in alongside the visitor's website user role, so guest-owned rows stay listable and readable without claiming them onto created_by_website_user_id. The same conditioned public match also carries public per-field read and write grants for that entry after sign-in (so cart line fields and quantity updates keep working without duplicating public field ACL onto the signed-in role). Public create is never OR'd into a signed-in role. Create requires mutate_own on that object type. A role whose object_types map lists any type and omits another type denies the omitted type, even when public create is true. An empty object_types map grants nothing; a role must list every type it may act on. Anonymous create/update uses field grants, a honeypot, and a cookie rate limit of 20 mutations per minute. List and get are not rate limited. Public create and update also reject a missing formStartedAt and a submit sooner than antiSpam.minFillMs milliseconds after that stamp (default 2000, allowed 0–10000). The page stamps formStartedAt when the data-request provider hydrates, so a click inside that window on a freshly loaded page fails with form.too_fast. A stamp older than 2 hours is rejected with form.spam_rejected. A millisecond stamp still in the future is also form.spam_rejected. The age is server receive time minus the stamp. A stamp taken when the request is sent does not return form.too_fast when that trip is longer than antiSpam.minFillMs. A failed run includes errorCode next to the message. Set antiSpam.minFillMs to 0 on a one-button checkout. The honeypot and the rate limit stay. Prefer save_component_preset kind=form for starters. When the linked form component mode is login, register, request_password_reset, or update_own, runMutation uses that mode. Email and password stay in fieldValues. There is no websiteUserSignIn or websiteUserSignUp button action. Sign in or sign up with a user-kind form whose formMode is login or register. formMode lives on that page component at content.root.props.formMode. Set args.formComponentId to that page component's id, then use a create or update data request, and a button action runMutation. The site creates the page path. The public create path also rejects empty required object fields on the server even if client attributes are removed. A create or update response reloads the row from the primary and returns the selected fields even when view_all is false. A field with read false is still omitted. When a mutation fails, the button that names that request shows the server error on its label (or errorText when that prop is set) and clears the loading state.

Recipes

Contact form: variables per field + VariableInputBlock + dataRequest op create with args.fieldValues from {{var:*}} + Button runMutation.
Search / list: variables q (text) and hits (entry[]) + dataRequest op list with args.searchQuery {{var:q}} and resultWrites to hits + VariableInputBlock + Button runRequest + VariableArrayTemplateBlock with arrayBinding {{var:hits}} and slot content using {{var:item.<fieldKey>}} (entry fieldValues are flattened onto item). Wrap the template (or its slot) in FlexListBlock/GridListBlock for gaps and columns.
Instant list edits (cart qty): on VariableArrayTemplateBlock set rowLocals (e.g. id quantity, fromItemField quantity, writeBack to a named update request + fieldKey) and optional listName + clientAggregates. Plus/minus Buttons use updateVariables add/subtract on quantity (instant) and are not locked while requests are pending — bind {{var:rowLocalMeta.quantity.pending}} / .error only when you want opt-in busy UI. A VariableInputBlock in the same row with variableId set to that mutable rowLocal (e.g. quantity), control: "number", and clampMin: 1 (optional clampMax) types the same local and shares writeBack; place it between the stepper buttons. Derived rowLocals (derived.op: product of local/item factors) expose instant line totals such as {{var:line_total}} for display and clientAggregates; item factors read raw numbers from fieldValuesNumeric when a select entry uses format number (so currency display strings do not coerce to 0). Optional numberFormat.currency (ISO 4217) on a derived local or clientAggregate formats that bind for display while math stays numeric. writeBack debounces the update mutation with a patched item; set objectTypeRefresh: skip to avoid automatic list/get fan-out when locals and clientAggregates already show optimistic UI (paid totals stay on server aggregates refreshed by checkout or an explicit runRequest). Badges bind {{bind:lists.<listName>.aggregates.<as>}} for client sum/count before the server round-trip — the same listName is shared across the page and chrome header.
Refresh: Button runRequest on the same list/get name. After runMutation, action.onSuccess (stored as onSuccessActions) may runRequest, navigate, updateVariables, or open a modal. A step's type may be sent as kind. Unknown action keys warn and are dropped. Put navigate last when a later authored runRequest must finish before leaving. When onSuccess includes navigate, the mutation skips the awaited same-objectType list/get refresh so automatic re-runs (including lists whose args mention a resultWrite variable such as {{var:id}}) do not delay location.assign; stay-on-page mutations still await that refresh. A list or get whose args mention {{var:id}} also re-runs when that variable changes. A variable used only inside an include re-fetches that include; Button runRequest include set to the alias does the same.
Size selector: an array-of-text variable (VariableInputBlock renders add/remove rows) or a list write with source images[].size or results[].size, distinct true, optional sortBy value and orderFrom the parent sizes field, and defaultVariableId set to the selection variable. Repeat set-variable buttons in a VariableArrayTemplateBlock ({{var:item}}, minItems 2 so one size hides the selector). Filter the gallery with VariableArrayTemplateBlock itemFilter on {{var:size}} (whenEmpty no-filter or no-results) and optional emptyContent. A lone matching button is aria-pressed. In a group, the selected button is aria-checked with data-selected.
Product detail (one get, as on products/[slug]): one get, forward select such as category.name, and reverse includes for sections and images. Map inputs from requests.<name>.results and requests.<name>.results.<as>.
Paging: args.page {{bind:query.page}} or {{var:page}} with syncUrl, and a limit. A direct load of ?page= uses that page on first render. A page past pageCount clamps the request to the last page. When args.page is {{var:id}} and offset is omitted, that variable is set to the clamped page. Changing another synced variable resets the page to 1. Button requestNextPage and requestPrevPage (query key page) write the next or previous page and re-run. Bind {{bind:requests.<name>.total}}, .hasMore, and .page, or copy them with resultWrites source total, hasMore, or page.
Related posts: a list filter { fieldKey, operator: overlaps, valueFromRoute } on the shared relation, args.excludeRouteEntry, and args.fallback when the overlap is shorter than limit. SlotSliderBlock.arrayBinding repeats the first slide per item with {{var:item.*}}.

Introspection

get_pages / get_components mode=detailed returns requests, requestsDetailed (args, select, include with that include's own dependencies, resultWrites), inputSchema, clientDependencies for client-side list filters, and parseErrors. Parent request dependencies omit variables used only inside an include. get_design_warnings reports unknown blocks/actions, misplaced keys, and unparseable rows.

Presets and migrate

MCP save_component_preset {objectTypeId, kind: list|detail|form}. The list preset includes VariableArrayTemplateBlock bound to {{var:hits}} with a sample {{var:item.*}} heading. List rows use VariableArrayTemplateBlock and page-safe blocks.