Skip to main content

Module render

Module render 

Source
Expand description

Default render path + recursive stream walker.

Templates reach this through the stream_render Tera function (block::tera_helpers).

§Default render

default_render walks a block’s crate::Block::fields in order, deserializes each field’s slice of the block value, and feeds the lot into the block’s Tera template (blocks/<type_name>.html unless crate::Block::template overrides). Nested Stream / Repeat fields recurse via prerender_stream.

§Stream walker

prerender_stream takes a JSON Value::Array of {type, id, value} entries, looks up each block in the registry, calls crate::Block::render, and concatenates the result. Unknown type values surface a minimal yellow drift-banner snippet rather than panicking — admins fix this in the editor by removing the orphan block.

Functions§

default_render
Walk a block’s fields and render its template.
prerender_stream
Walk a JSON array of {type, id, value} entries and concatenate each block’s Block::render output.