---
title: Layouts
project: OpenTemplates
version: 1.0
section: guides
language: en
license: MIT
url: https://totaljs.es/docs/opentemplates/1-0/guides/layouts/
updated: 2026-11-19T07:56:18.767Z
---

# Layouts

> Edit the HTML page that wraps every template of a profile.

Every profile has one layout. The layout is a full HTML page, and every template of the profile is rendered inside it. Put the styles, fonts and helpers that all your documents share in the layout.

## Edit the layout

**1.** On the **Profiles** page, click the gear of the profile.

**2.** Click **Update template**.

**3.** Edit the HTML on the left. The right side shows a preview.

![The layout editor](/files/JapW2N4tY60f.webp)

**4.** Click **SUBMIT** to save.

## The default layout

A new profile starts with this layout:

```html
<!DOCTYPE html>
<html>
<head>
	<title>OpenTemplates</title>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
	<meta http-equiv="X-UA-Compatible" content="IE=edge" />
	<meta name="viewport" content="width=device-width, initial-scale=1.0" />
	<style>
	{{ if $.preview }}
		body { background: #F0F0F0; padding: 15px; font-family: Arial; font-size: 14px; color: #000; }
		page { background: #FFF; display: block; margin: 0 auto; margin-bottom: 0.5cm; box-shadow: 0 0 20px #D0D0D0; width: 21cm; min-height: 29.7cm; }
	{{ else }}
		body, page { padding: 0; margin: 0; box-shadow: 0; background: #FFF; }
	{{ fi }}
	</style>
</head>
<body>

	<page>
		{{ value | raw }}
	</page>

	<script>

		// Custom helpers

		Thelpers.amount = function(val) {
			return val.format(2) + ' &euro';
		};

	</script>

</body>
</html>
```

Three parts matter:

- `{{ value | raw }}` is where the rendered template goes. Keep it in every layout.
- `{{ if $.preview }}` is true only in the editor preview. The default layout uses it to show an A4 sheet on a grey background in the editor, and a plain white page in the real output.
- The `<script>` block holds helpers. Helpers defined in the layout work in every template of the profile. See [Template syntax](../template-syntax/).

The default `amount` helper writes `&euro` without the closing semicolon. Change it to `' &euro;'` if you use it.
