Skip to main content

Module render

Module render 

Source
Expand description

Render a resolved Page through Tera.

The flow:

  1. Look up the PageType row via page.page_type_id.
  2. Find the registered PageTypeHandler by type_name.
  3. Ask the handler for its typed extension as JSON (load_extension).
  4. Build a Tera context with page / page_type / extension / children / ancestors / breadcrumbs.
  5. Render the page’s own template_override when it names a template that exists, else page_type.default_template (see pick_template).

Functions§

render
Render page to an HTTP response. On any failure (missing page-type row, missing handler, template error) returns a 500/404 response with a short diagnostic body.
render_negotiated
render, plus the client’s media-type preference.
render_preview
Render page using virtual extension data drawn from a posted form HashMap instead of the persisted row. The page row itself is still rendered verbatim, so callers should pre-overlay the form’s canonical fields onto the Page before calling.
render_with_route
Render page as a routable-page hit. The matched route’s name + named capture groups are exposed to the template as route_name and route_captures; the handler’s route_context override gets a chance to inject additional ctx before the framework keys are stamped.