Expand description
Public form renderer.
Turns a schema::Form into the HTML a visitor fills in. The output is
the contract form_runtime.js enhances: pages are <fieldset data-rcms-page> blocks the runtime shows one at a time; with JS off all
pages are visible and the form still submits + server-validates.
Provenance + per-embed overrides: the form carries a hidden _form
(form id), _embed (the embedding block’s uuid), and a cache-safe
_csrf field populated from the double-submit cookie by an inline
script (the rendered HTML may be page-cached, so no per-user token is
baked in). The submit handler reads the Referer for the source
page and resolves the embed’s override from that page’s stream by uuid.
Constants§
- HONEYPOT_
FIELD - Honeypot field name — a hidden input bots tend to fill.
Functions§
- render_
form_ html - Render a whole form to HTML.
embed_idis the embedding block’s uuid (empty when previewed standalone).submit_actionis the POST target.