---
title: "web render · RUAL Documentation"
description: "Renders the page template on the server and answers the request with the finished HTML: title, description, canonical link, Open Graph and Twitter tags,…"
canonical: https://docs.rual.nl/block-types/web/web_render
language: en
---

# web render

This block is part of the [`web`](https://docs.rual.nl/block-types/web) group and was last modified in core [`v15.0.1`](https://docs.rual.nl/core-versions/150001).

Renders the page template on the server and answers the request with the finished HTML: title, description, canonical link, Open Graph and Twitter tags, hreflang links and JSON-LD are written for you. Custom pins become template variables.

- flow

- connection `httpconnection` required

- template `value` The page template (HTML with {{mustache}}). Leave unwired to use the template stored on this block.

- data `object` The template's variables.

- title `value` Page title: ` `, og:title.

- description `value` Meta description and og:description.

- image `value` Share image (og:image, twitter:image). A /path becomes an absolute URL.

- canonical `value` Canonical URL; defaults to this page's URL without query.

- layout `value` Name or GUID of a stored template that wraps the page; it prints the page with `{{{body}}}`.

- meta `object` More head tags as {name: content}, e.g. {"robots": "noindex", "og:type": "product"}.

- JSON-LD `object` Structured data written as application/ld+json.

- status `number` HTTP status code.

Default `200`

- cache seconds `number` How long shared caches may keep the page. 0 (default): browsers revalidate with the ETag every time.

Default `0`

- headers `array ` Extra response headers, [{key, value}].

- flow

- connection `httpconnection`

- html `value` The finished HTML document.

- success `condition`

- error `value`

Renders the `template` pin (or, when unwired, the template stored on the block's `html` field) with the web template engine: Mustache ({{x}} escaped, {{{x}}} raw, {{#list}}..{{/list}}, {{^x}}) plus {{if a == 'b'}}..{{else if}}..{{else}}..{{/if}}, {{for item in items}}..{{else}}..{{/for}}, {{@index}}/{{@number}}/{{@first}}/{{@last}}, {{> name}} partials (stored web templates by name, or {{define "name"}} blocks), {{t "key" n=count}} translations, and filters {{price | money "EUR"}}, number, date "DD-MM-YYYY", upper, lower, truncate N, default x, json, join, length, nl2br, urlencode, plus/minus/times/divide, round, slug. Escaping follows the HTML context: javascript: URLs are refused, <script> code gets JSON (write `const x = {{x}};` without quotes). Compile errors: a {{> partial}} anywhere but where text goes; if/else or section branches that end in different HTML places (open and close tags inside each branch); a URL scheme formed by data (write `https://{{host}}`). Template variables: the `data` object's fields, every custom pin by id, `web` {language, nonce, url, path, origin, action, signed_in}, and title, description, nonce, language, head. Document: a template starting with <!doctype or <html is the whole document; else `layout` (a stored template by name or GUID, the same documents mail templates use, rendered with {{{body}}} = the page and {{{head}}} = the head tags; also the block's template_guid) wraps it; else a plain HTML5 shell. Head tags (title, meta description, canonical = the page URL unless set, og:*, twitter:*, hreflang alternates, JSON-LD from `json_ld`, `meta` extra {name: content}, the runtime script and prefetch rules) go where {{{head}}} is, else before </head>; a tag the markup's head already has is not repeated. Response: `status` (default 200), `headers` [{key,value}], `cache` seconds (>0 lets shared caches keep it; ignored for a signed-in visitor), ETag with 304, a per-response CSP nonce (write nonce="{{nonce}}" on inline scripts; inline on* handlers are blocked). A template error renders a 500 page that names it and sets success=false, error. Out-pin html is the finished document. Outside a web page (an API endpoint flow) it answers its connection with text/html instead.

| `render html` |
| --- |
| `html template` |
| `web template` |
| `server side render` |
| `ssr` |
| `og tags` |
| `seo` |

The page reads `:slug` off its params with [get fields](https://docs.rual.nl/block-types/object/object_field_getter_multiple), and [search single](https://docs.rual.nl/block-types/storage/function_search_single_result) finds the document. [web render](https://docs.rual.nl/block-types/web/web_render) then answers the request: the fields of the object on its data pin become template variables, and a custom pin, here `note`, adds a value of your own. The template is a [value](https://docs.rual.nl/block-types/value/value_default) that names a stored partial. The head tags are written for you from the title, description and image pins. A template error renders a 500 page that names it and turns success off.

[![Studio canvas example for the web render block: rendering a stored document.](https://docs.rual.nl/canvas-examples/web_render.png)](https://docs.rual.nl/canvas-examples/web_render.png?v=3)

## Used in these guides

These documentation pages use or explain this block:

- [Building a Dashboard with Charts](https://docs.rual.nl/tutorials/dashboard-charts)

- [Building a Login Page](https://docs.rual.nl/tutorials/login-page)

- [Building User Authentication](https://docs.rual.nl/tutorials/user-authentication)

- [Escaping and Security](https://docs.rual.nl/web/security)

- [Forms and Validation](https://docs.rual.nl/web/forms)

- [How Web Pages Work](https://docs.rual.nl/web/overview)

- [Layouts and Partials](https://docs.rual.nl/web/layouts-and-partials)

- [Migrating from State Pages](https://docs.rual.nl/web/migrate-from-state-pages)

## Version history

Introduced in [`v15.0.1`](https://docs.rual.nl/core-versions/150001).

- [`v15.0.1`](https://docs.rual.nl/core-versions/150001): block added in this release.

- [Back to `web`](https://docs.rual.nl/block-types/web): Return to the main group to view all sub-groups

- [Back to `web pages`](https://docs.rual.nl/block-types/web?group=web%20pages): Return to the group to view all blocks within this group
