---
description: Building a template from the base template — the file layout the upload accepts, the black-body rule, inline or external CSS and JavaScript, relative paths and no external dependencies, screen size, performance, and packaging the ZIP.
---

# Getting started with templates

A template is an ordinary web page — `index.html`, `styles.css`, optionally `script.js`
and an `assets/` folder — zipped and uploaded to the [template library](template_library.md).
The sign player loads it full-screen, binds it to the schedule, and keeps it running for
days. This page covers the structure every template shares and the rules the upload
enforces; the pages under *Data binding* explain how the page reads the schedule.

## Where to work

Any editor with a live HTML preview does for the first draft; `index.html` opens in a
browser as an ordinary page, with its data-bound fields empty. Once uploaded, click the
template's title in the [template library](template_library.md) to preview it with sample
data, or open it in the [Template Editor](template_editor_analysis.md), which edits the
template in place and previews it with sample or real event data, so a template can be
finished there — see [Testing and troubleshooting templates](testing_troubleshooting.md).

## The base template

**Download Base Template** on the Templates page (or [here](../assets/templates/Base_Template.zip))
gives you a ZIP that already follows every rule on this page: the required files, a body that
stays black, and a container that is your working area.

`index.html`:

```html
<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>[Insert Template Title Here]</title>
    <link rel="stylesheet" href="styles.css" />
  </head>
  <body>
    <!-- ! Consider this div as your body and insert all your content inside this div. Do not put anything outside of this div -->
    <div id="your-content" class="your-content"></div>
  </body>
</html>
```

`styles.css`:

```css
/* Global reset */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body,
html {
  width: 100%;
  height: 100%;
}

/* ! DO NOT MODIFY THE BODY CSS */
body {
  background-color: #000;
  cursor: none;
}

/* ! This div acts as your body */
.your-content {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: #fff; /* This acts as your body background color. You can change it to any color you want apart from making it transparent. */
  /* You can add a background image */
  /* background-image: url(./assets/); */
  z-index: 9999;
  pointer-events: none;
}
```

### Keep the body black

The sign player guarantees a black fallback body background, so an unstyled body can never
flash white when switching between templates. A background you set yourself takes priority
over that fallback — but keeping your own body black matches the player's base, so switches
stay seamless. The `.your-content` container acts as your actual working area where you can
set any background color or image you want.

- **Do** put all your content inside the `#your-content` div, style `.your-content` with
  your background, and keep the body black (`#000`).
- **Don't** place content outside `.your-content`, make its background transparent, or give
  the body a light background — a light body is visible during template switches and, if set
  in `styles.css`, may blink black for a frame while the stylesheet applies.

## Template structure

```text
my-template/
├── index.html          # required
├── styles.css          # required — the only stylesheet
├── script.js           # optional
└── assets/
    ├── images/
    ├── fonts/
    └── videos/
```

The upload enforces this layout:

- The ZIP root may contain **only** `index.html`, `styles.css` and `script.js`, plus the
  `assets/` folder. Any other root file or folder is rejected — including a wrapper folder,
  so zip the *contents* of your template folder, not the folder itself.
- `index.html` and `styles.css` are required even when all your CSS is inline; keep the
  base template's `styles.css` in that case.
- `styles.css` is the only stylesheet: no other `.css` files at the root or under `assets/`.
  Put extra styles in `styles.css` or in inline `<style>` blocks.
- Additional JavaScript files are allowed only inside `assets/` (for example
  `assets/js/animations.js`), referenced with a normal `<script>` tag. Scripts go at the very
  end of `<body>`; the stylesheet is linked in `<head>`.
- Images, fonts and videos go under `assets/`; `.html`, `.css`, archives and executables are
  not allowed there.
- File and folder names must be plain ASCII without spaces or punctuation that needs URL
  encoding (`: / ? # [ ] @ ! $ & ' ( ) * + , ; =`). Links are case-sensitive on the sign:
  `Logo.png` and `logo.png` are different files.

Scripts must not load files from the ZIP at runtime — no `fetch('assets/…')`,
`import('./…')` or asset paths in string literals. Reference every asset from `index.html`
or `styles.css`; the full list of rules for `script.js` is on
[Template JavaScript best practices](advanced/template-js-best-practices.md).

### Inline or external

For a small template, CSS in a `<style>` block and JavaScript in a `<script>` block at the
end of `<body>` is fine; above a few dozen lines, external `styles.css` and `script.js` are
easier to maintain and are what the Template Editor shows as separate files. Either way the
ZIP still needs `styles.css` at the root.

## Assets

**Always use relative paths**:

```html
<img src="assets/images/logo.png" alt="Logo" />
<video src="assets/videos/intro.mp4" autoplay muted loop playsinline></video>
```

```css
background-image: url("assets/images/background.jpg");
```

Relative paths work in inline SVG too, including `<image xlink:href="assets/…">` and `url()` in
the SVG's own `<style>` block, as design tools often export them.

An absolute path (`C:/Users/…`, `/var/www/…`) breaks as soon as the template leaves your
machine. A `<video>` needs more than a path to run reliably on a sign — `autoplay` only
works together with `muted`, and long-running loops need cleanup; see
[Embedding video](advanced/embedding_video.md).

**Do not rely on CDN links or external resources.** Signs may run on restricted networks or
offline, and only files bundled in the ZIP are cached on the sign. Instead of a
`<link href="https://cdn…">` or `<script src="https://…">`, download the library and bundle
it (combine it into `script.js`, or place it under `assets/`), and download fonts into
`assets/fonts` — see [Fonts](basic/font_configuration.md). Background and banner images
have their own page: [Background and banner images](basic/layout_assets_configuration.md).

Keep images close to the size they are displayed at and compress them; a sign that loads a
4000 × 3000 photo for an 800 × 600 slot wastes memory for days. Small icons can be embedded
as `data:` URIs.

## Screen size

A sign's screen size is set on the room (or the event's default) and shown as the room's
**Dimensions**. Design for the exact resolution the screens will have — 1920 × 1080 for
landscape Full HD, 1080 × 1920 for portrait — and record it as the template's **Default
Pixel Width** and **Height** at upload so the library shows what the template targets.

Prefer layouts that fill the viewport (`width: 100%; height: 100%` on `.your-content`,
viewport units, flex or grid) over hard-coded pixel sizes, so the same template serves
screens that differ slightly. Templates the app generates for you from a media file or URL
offer this choice explicitly as **Responsive** or **Absolute** (see the
[template library](template_library.md#html-template-upload)). Hide scrollbars with
`overflow: hidden` on the container.

## Performance

Signs run for days without a reload:

1. **Avoid memory leaks** — clear intervals and timeouts, or use the template lifecycle
   hooks that clean up for you (see
   [Template JavaScript best practices](advanced/template-js-best-practices.md)).
2. **Use CSS animations** over JavaScript where possible, and animate `transform` and
   `opacity` rather than `width`, `height`, `top` or `left`.
3. **Limit DOM manipulation** — update content, don't rebuild sections.
4. **Test long-running behavior** — a template should look the same after hours.

## Packaging and uploading

1. Zip the *contents* of your template folder so `index.html` sits at the ZIP root.
2. Upload it on the Templates page, or from an event's or room's settings dialog
   (see [Template library](template_library.md#uploading-a-template)). The upload checks the
   structure and runs a static analysis; errors are listed with the reason.
3. Assign the template to an event, a room or an item
   ([How templates are assigned](../getting-started/template_assignment.md)) and check the
   sign, or click the template's title in the library first to preview it with sample
   data.

Before uploading, run through [Testing and troubleshooting templates](testing_troubleshooting.md).

## Related

- [Template library](template_library.md) — uploading, the checks, versions
- [Displaying JSON values](basic/json_value_configuration.md) — binding the schedule into the page
- [Template JavaScript best practices](advanced/template-js-best-practices.md)
- [Testing and troubleshooting templates](testing_troubleshooting.md)
- [Example templates](example_templates.md)
