> ## Documentation Index
> Fetch the complete documentation index at: https://docs.t3planet.de/en/latest/llms.txt
> Use this file to discover all available pages before exploring further.

# Templating

> Write Fluid templates for Tonictypes plugins: the dv namespace, available variables like records and record, a list example, and TypoScript templates.

Tonictypes uses normal TYPO3 Fluid.

Every Tonictypes plugin loads the records, prepares a set of variables and hands them to a Fluid template that you choose in the plugin. You can start with the built-in **Debug Template**, which prints all available variables, and then switch to your own template file, inline Fluid in the plugin, or a template registered in TypoScript. The choices themselves are described in [Plugin configuration → Templates](https://docs.t3planet.de/en/latest/en/latest/TonicTypes/FrontendPlugins/DisplayRecordsPlugin/Index.md#templates).

## Namespace

Use **`dv:`** (`K3n\Tonictypes\ViewHelpers`). Registered automatically with Core. For the optional `xmlns` snippet (IDE autocompletion) see [ViewHelpers → Namespace](https://docs.t3planet.de/en/latest/en/latest/TonicTypes/ViewHelpers/Index.md#namespace).

## Variables

| Context | Default variable |
| - | - |
| List | `{records}` — all records the plugin found, ready for `f:for` |
| Detail | `{record}` — the one record of a Detail or Dynamic Detail plugin |
| One field | `{record.fieldname}` — the value of a field, by its variable name |

The plugins also provide:

| Variable | Contains |
| - | - |
| `{datatype}` | The selected datatype object (name, table, fields) |
| `{detailPid}` | The page set as **Page for Detail View**, for building detail links |
| `{overallCount}` | Number of records found (List) |
| `{settings}` | All plugin settings |
| `{cObj}` | Data of the current content element (e.g. its uid or header) |
| `{p_paginator}`, `{p_paging}`, `{p_pages}` | Pagination objects, only when **Enable Pagination** is on |

Injected [Template Variables](https://docs.t3planet.de/en/latest/en/latest/TonicTypes/GettingStarted/CreatingATemplateVariable/Index.md) appear under their own names.

Debug with `<f:debug>{_all}</f:debug>` or `<f:debug>{record.fieldname}</f:debug>`.

### Example: list template for Demo Articles

```html theme={"theme":{"light":"github-light","dark":"github-dark"}}
<f:for each="{records}" as="record">
  <article>
    <h2>
      <dv:link.record record="{record}" pageUid="{detailPid}">{record.title}</dv:link.record>
    </h2>
    <f:if condition="{record.subtitle}"><p class="lead">{record.subtitle}</p></f:if>
    <p>{record.description}</p>
  </article>
</f:for>
```

`title`, `subtitle` and `description` are the variable names of the fields from the [Getting Started example](https://docs.t3planet.de/en/latest/en/latest/TonicTypes/GettingStarted/Index). The link points to the detail page, where a **Record Dynamic Detail** plugin renders the same record as `{record}`.

## Predefine templates in TypoScript

Register templates under `plugin.tx_tonictypes.templates` — TypoScript example: [Installation → Predefined templates](https://docs.t3planet.de/en/latest/en/latest/TonicTypes/Installation/Index.md#predefined-templates). They then appear in the plugin under **Predefined Templates**.

This is the recommended way for sites with several plugins: editors pick a named template from a list instead of typing file paths, and the integrator can change the file in one place. The `group`, `name` and `icon` settings only control how the template is presented in the selector.

![Template selector](https://mintcdn.com/t3planet/o3JLbgRgJ_cVW1JX/en/latest/TonicTypes/GettingStarted/Templating/Images/template_selection.webp?fit=max\&auto=format\&n=o3JLbgRgJ_cVW1JX\&q=85\&s=29e0491091943f832c44d7436999d22b)

*Debug · custom path · inline Fluid · TypoScript templates*

The same identifier can be rendered anywhere in Fluid, for example to reuse a "teaser" template inside another template:

```html theme={"theme":{"light":"github-light","dark":"github-dark"}}
<dv:template.render template="myTemplateIdentifier" arguments="{record:record}" />
```

More ViewHelpers: [ViewHelpers](https://docs.t3planet.de/en/latest/en/latest/TonicTypes/ViewHelpers/Index.md).

## Next

[Frontend Plugins](https://docs.t3planet.de/en/latest/en/latest/TonicTypes/FrontendPlugins/Index)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.