---
title: "View models"
manual: "Handlebars"
version: "main"
permalink: "https://docs.typo3.org/permalink/cpsit/typo3-handlebars-forms:view-models@main"
source: "DeveloperCorner/ViewModels.rst"
rendered: "2026-09-29T09:18:02+00:00"
---

# View models {#view-models}

Renderables are converted to so-called *view models*, which is done by dedicated *view model builders*.
Each view model represents the default view implementation of a renderable, based on the Fluid templates
shipped by EXT:form. Note that some renderables might be represented by various view model implementations,
based on specific aspects outlined below.

> [!TIP]
> You can also create custom view model builders by implementing the
> `\CPSIT\Typo3HandlebarsForms\Domain\ViewModel\Builder\ViewModelBuilder` interface.

Where a renderable can resolve to more than one view model, each possible outcome is listed as
its own sub-section below, named after the condition under which it applies.

> [!NOTE]
> **See also**
>
> [Choosing a view model type](https://docs.typo3.org/permalink/cpsit/typo3-handlebars-forms:custom-vmb-view-model-types@main) explains what each
> view model type below is for and when to use it in a custom builder.

The following renderables are currently supported by this extension. The table below
gives a quick overview; each renderable is covered in detail further down, including
the exact conditions for each outcome.

-   [Overview](https://docs.typo3.org/permalink/cpsit/typo3-handlebars-forms:overview@main)
-   [Supported renderables](https://docs.typo3.org/permalink/cpsit/typo3-handlebars-forms:supported-renderables-1@main)
-   [Unsupported renderables](https://docs.typo3.org/permalink/cpsit/typo3-handlebars-forms:unsupported-renderables-1@main)

## Overview {#view-models-overview}

| Renderable | View model |
| --- | --- |
| `AdvancedPassword` | `ViewModelCollection` |
| `Checkbox` | `ViewHelperContainedViewModel` |
| `ContentElement` | `ViewHelperContainedViewModel` (valid UID) or `SimpleViewModel` (invalid UID) |
| `CountrySelect` | `ViewHelperContainedViewModel` |
| `Fieldset` | `StandaloneTagViewModel` |
| `FileUpload`, `ImageUpload` | `ViewModelCollection` (resolved) or `ViewHelperContainedViewModel` (unresolved) |
| `Form` | `ViewHelperContainedViewModel` |
| `Hidden` | `ViewHelperContainedViewModel` |
| `MultiCheckbox` | `FormFieldViewModel` or `ViewHelperContainedViewModel` (per option) |
| `Password` | `ViewHelperContainedViewModel` |
| `RadioButton` | `FormFieldViewModel` or `ViewHelperContainedViewModel` (per option) |
| `SingleSelect`, `MultiSelect` | `ViewHelperContainedViewModel` |
| `StaticText` | `FormFieldViewModel` (label available) or `StandaloneTagViewModel` (no label) |
| `Textarea` | `ViewHelperContainedViewModel` |
| `Text`, `Date`, `Email`, `Number`, `Telephone`, `Url` | `ViewHelperContainedViewModel` |
| `DatePicker` | *not supported* |

## Supported renderables {#supported-renderables}

### `AdvancedPassword` {#advanced-password}

Represented by `ViewModelCollection`, containing two child view models:

-   **`passwordField`**

    `ViewHelperContainedViewModel` — result from `<formvh:form.password>` view helper
    invocation for the password field.

-   **`confirmationField`**

    `FormFieldViewModel` or `ViewHelperContainedViewModel` — result from
    `<formvh:form.password>` view helper invocation for the confirmation field, combined
    with the confirmation label when available; otherwise returned standalone.

### `Checkbox` {#checkbox}

Represented by `ViewHelperContainedViewModel`, containing the result from
`<formvh:form.checkbox>` view helper invocation.

### `ContentElement` {#content-element}

**Configured content element UID is valid**

Represented by `ViewHelperContainedViewModel`, containing the result from
`<f:cObject>` view helper invocation.

**Configured content element UID is invalid**

Represented by `SimpleViewModel` as fallback, used when the configured UID cannot
be resolved.

### `CountrySelect` {#country-select}

Represented by `ViewHelperContainedViewModel`, containing the result from
`<formvh:form.countrySelect>` view helper invocation.

### `Fieldset` {#fieldset}

Represented by `StandaloneTagViewModel`, containing the `<fieldset>` tag with class
name(s) and additional attributes.

### `FileUpload`, `ImageUpload` {#file-upload}

**Uploaded resource can be resolved**

Represented by `ViewModelCollection`, containing three child view models:

-   **`uploadField`**

    `ViewHelperContainedViewModel` — result from `<formvh:form.uploadedResource>`
    view helper invocation for the upload field.

-   **`resourcePointerFields`**

    `ViewModelCollection` of `StandaloneTagViewModel` — optional; references
    hidden `<input>` fields with resource pointers, if available.

-   **`uploads`**

    `ViewModelCollection` of `FileResourceViewModel` — references file uploads.
    Each contains a `resource` (`FileReference` or `PseudoFileReference`) and,
    optionally (TYPO3 >= v14), a `deleteCheckbox` (`FormFieldViewModel`) to delete
    the upload on submit.

**Uploaded resource cannot be resolved**

Represented by `ViewHelperContainedViewModel`, containing the result from
`<formvh:form.uploadedResource>` view helper invocation.

### `Form` {#form}

Represented by `ViewHelperContainedViewModel`, containing the result from
`<formvh:form>` view helper invocation.

### `Hidden` {#hidden}

Represented by `ViewHelperContainedViewModel`, containing the result from
`<formvh:form.hidden>` view helper invocation.

### `MultiCheckbox` {#multi-checkbox}

Contains one view model per available option, each as one of:

**Label is available**

Represented by `FormFieldViewModel`, combining the label and result from
`<formvh:form.checkbox>` view helper invocation.

**Associated label is invalid or missing**

Represented by `ViewHelperContainedViewModel`, containing the result from
`<formvh:form.checkbox>` view helper invocation.

### `Password` {#password}

Represented by `ViewHelperContainedViewModel`, containing the result from
`<formvh:form.password>` view helper invocation.

### `RadioButton` {#radio-button}

Contains one view model per available option, each as one of:

**Label is available**

Represented by `FormFieldViewModel`, combining the label and result from
`<formvh:form.radio>` view helper invocation.

**Associated label is invalid or missing**

Represented by `ViewHelperContainedViewModel`, containing the result from
`<formvh:form.radio>` view helper invocation.

### `SingleSelect`, `MultiSelect` {#select}

Represented by `ViewHelperContainedViewModel`, containing the result from
`<formvh:form.select>` view helper invocation. Includes available `<option>` tags as children
of type `StandaloneTagViewModel`.

### `StaticText` {#static-text}

**Label is available**

Represented by `FormFieldViewModel`, combining the label and a `<p>` tag.

**Label is invalid or missing**

Represented by `StandaloneTagViewModel`, containing a `<p>` tag with class and text.

### `Textarea` {#textarea}

Represented by `ViewHelperContainedViewModel`, containing the result from
`<formvh:form.textarea>` view helper invocation.

### Text and other text-based fields {#text}

Applies to `Text`, `Date`, `Email`, `Number`, `Telephone`, and
`Url`.

Represented by `ViewHelperContainedViewModel`, containing the result from
`<formvh:form.textfield>` view helper invocation.

## Unsupported renderables {#unsupported-renderables}

### `DatePicker` {#date-picker}

This form element was [deprecated in TYPO3 v14.2](https://docs.typo3.org/c/typo3/cms-core/main/en-us/Changelog/14.2/Deprecation-109152-FormDatePickerElement.html#deprecation-109152-1741600000)
and is therefore not supported by this extension.

> [!NOTE]
> **See also**
>
> View the sources on GitHub:
>
> -   [ViewModelBuilder](https://github.com/CPS-IT/handlebars-forms/blob/main/Classes/Domain/ViewModel/Builder/ViewModelBuilder.php)
