Skip to main content

render_preview

Function render_preview 

Source
pub async fn render_preview(
    t: &Tenant,
    tera: &Tera,
    page: &Page,
    url_prefix: &str,
    site_prefix: &str,
    locale_code: Option<&str>,
    form: &HashMap<String, String>,
    accept: Accept,
    force_json: bool,
) -> Response
Expand description

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.

Powers the “preview unsaved changes” iframe in the editor: the admin’s edit form POSTs its current state to a preview endpoint that builds a virtual Page + delegates here. Nothing is persisted.