---
title: "Render.text ViewHelper <f:render.text>"
manual: "Fluid ViewHelper Reference"
version: "main"
permalink: "https://docs.typo3.org/permalink/t3viewhelper:typo3-fluid-render-text@main"
source: "Global/Render/Text.rst"
modified: "2026-09-17T05:12:06+00:00"
---

# Render.text ViewHelper `<f:render.text>`

> [!NOTE]
> **New in version 14.2**
>
> This ViewHelper should be used whenever text fields from records are
> displayed in HTML output. It can replace `{record.my_inputfield}` for
> input fields, as well as `<f:format.nl2br>{record.my_textarea}</f:format.nl2br>`
> and `<f:format.html>{record.my_richtext}</f:format.html>`

ViewHelper to render content based on records and fields from a TCA schema. Handles the processing of both simple and rich text fields. By default, accessing a missing field raises an error. Set `optional` to `true` to return null instead.

Can also handle extbase models, you still need to provide the field name, not the property name.

Go to the source code of this ViewHelper: [Render\\TextViewHelper.php (GitHub)](https://github.com/TYPO3/typo3/blob/main/typo3/sysext/fluid/Classes/ViewHelpers/Render/TextViewHelper.php).

The `<f:render.text>` ViewHelper renders text-based fields from a record
according to their TCA configuration, automatically applying the correct formatting
(for example plain text, line breaks, or rich text).

It provides a unified way to render text fields and avoids manual formatting
logic in templates.

Use this ViewHelper when rendering fields defined in TCA.

Do not use it for:

-   Non-TCA properties
-   Computed or virtual model properties

The ViewHelper is record-aware: it receives the full record and the field name,
and renders the field based on its TCA configuration.

The `record` argument accepts:

-   `RecordInterface`
-   `PageInformation`
-   `DomainObjectInterface`

This includes records, ContentBlockData objects, page information objects,
and Extbase models.

**Table of contents**

-   [Rendering texts with the record-transformation data processor](https://docs.typo3.org/permalink/t3viewhelper:rendering-texts-with-the-record-transformation-data-processor@main)
-   [Rendering multi-line texts, including rich text](https://docs.typo3.org/permalink/t3viewhelper:rendering-multi-line-texts-including-rich-text@main)
-   [Using the optional argument](https://docs.typo3.org/permalink/t3viewhelper:using-the-optional-argument@main)
-   [Rendering texts from Extbase models](https://docs.typo3.org/permalink/t3viewhelper:rendering-texts-from-extbase-models@main)
-   [Arguments of the <f:render.text> ViewHelper](https://docs.typo3.org/permalink/t3viewhelper:arguments-of-the-f-render-text-viewhelper@main)

## Rendering texts with the `record-transformation` data processor

You can use the `<f:render.text>` ViewHelper to render a TCA field, for
example of type [Input](https://docs.typo3.org/m/typo3/reference-tca/main/en-us/ColumnsConfig/Type/Input/Index.html#columns-input-renderType-default).

**Fluid**

**my_theme/Resources/Private/Templates/Content/MyContentElement.fluid.html**

```html
<f:render.text record="{record}" field="my_title" />
or
{f:render.text(record: record, field: 'my_title')}
or
{record -> f:render.text(field: 'my_title')}
```

**TypoScript**

**my_theme/Configuration/Sets/my_set/setup.typoscript**

```typoscript
tt_content.my_content_element {
    # ...
    dataProcessing {
        10 = record-transformation
    }
}
```

**TCA**

**my_theme/Configuration/TCA/Overrides/tt_content.php**

```php
<?php

use TYPO3\CMS\Core\Utility\ExtensionManagementUtility;

ExtensionManagementUtility::addTCAcolumns(
  'tt_content',
  [
    'tx_mytheme_link_label' => [
      'label' => 'my_theme.backend_fields:tt_content.tx_mytheme_link_label',
      'config' => [
        'type' => 'input',
        'size' => 30,
        'max' => 255,
      ],
    ],
  ],
);

ExtensionManagementUtility::addToAllTCAtypes(
  'tt_content',
  'tx_mytheme_link_label',
  'my_content_element',
  'after:bodytext',
);

```

## Rendering multi-line texts, including rich text

The `<f:render.text>` ViewHelper can also be used instead of the
[Format.html ViewHelper \<f:format.html>](https://docs.typo3.org/permalink/t3viewhelper:typo3-fluid-format-html@main)
or [Format.nl2br ViewHelper \<f:format.nl2br>](https://docs.typo3.org/permalink/t3viewhelper:typo3fluid-fluid-format-nl2br@main)
to render text textarea fields (See [TCA: Text areas](https://docs.typo3.org/m/typo3/reference-tca/main/en-us/ColumnsConfig/Type/Text/Index.html#columns-text))

It automatically determines the correct rendering method based on the field's
TCA configuration.

**Fluid**

**my_theme/Resources/Private/Templates/Content/MyContentElement.fluid.html**

```html
<f:render.text record="{record}" field="tx_mytheme_my_richtext" />

<f:render.text record="{record}" field="tx_mytheme_my_textarea" />
```

**TypoScript**

**my_theme/Configuration/Sets/my_set/setup.typoscript**

```typoscript
tt_content.my_content_element {
    # ...
    dataProcessing {
        10 = record-transformation
    }
}
```

**TCA**

**my_theme/Configuration/TCA/Overrides/tt_content.php**

```php
<?php

use TYPO3\CMS\Core\Utility\ExtensionManagementUtility;

ExtensionManagementUtility::addTCAcolumns(
  'tt_content',
  [
    'tx_mytheme_my_richtext' => [
      'label' => 'my_theme.backend_fields:tt_content.tx_mytheme_my_richtext',
      'config' => [
        'type' => 'text',
        'enableRichtext' => true,
      ],
    ],
    'tx_mytheme_my_textarea' => [
      'label' => 'my_theme.backend_fields:tt_content.tx_mytheme_my_textarea',
      'config' => [
        'type' => 'text',
        'cols' => 20,
        'rows' => 2,
      ],
    ],
  ],
);

ExtensionManagementUtility::addToAllTCAtypes(
  'tt_content',
  'tx_mytheme_my_richtext,tx_mytheme_my_textarea',
  'my_content_element',
  'after:bodytext',
);

```

## Using the `optional` argument

Accessing a field that is not available in a record usually raises an
exception. However, in shared templates that need to be rendered even if a field
happens to be missing in a particular record, setting the boolean argument
`optional` to `true` means the ViewHelper will return
`null` instead of an exception.

**SharedHeader.fluid.html**

```html
<f:variable name="header">{record -> f:render.text(field: 'header', optional: true)}</f:variable>
```

This is useful for shared partials such as in `fluid_styled_content`
where header partials can be reused by content elements when the transformed record
does not provide a `header` or `subheader` field. Without
`optional="true"`, rendering the partial would raise a
`RecordPropertyNotFoundException`. If `optional="true"`, the ViewHelper
returns `null` and the partial can continue to handle the missing value
gracefully.

## Rendering texts from Extbase models

The ViewHelper can also be used to display an
[Extbase model](https://docs.typo3.org/m/typo3/reference-coreapi/main/en-us/ExtensionArchitecture/Extbase/Domain/Model.html#extbase-model).

The Extbase model is internally converted to a
`RecordInterface` where the rendering method is
determined by the TCA definition of the field.

Usage with an Extbase model (property name differs from database field name):

**Fluid**

**my_theme/Resources/Private/Templates/MyController/MyAction.fluid.html**

```html
<!-- Use the field name from the TCA not from the model: -->
<f:render.text record="{myModel}" field="my_link_text" />
```

**Extbase model**

**my_theme/Classes/Domain/Model/MyModel.php**

```php
<?php

use TYPO3\CMS\Extbase\DomainObject\AbstractEntity;

class MyModel extends AbstractEntity
{
  // Extbase automatically maps this field to my_link_text
  protected string $myLinkText = '';
  protected string $myRecordType = '';

  // Getters and Setters
}

```

**TCA**

**my_extension/Configuration/TCA/Overrides/tx_myextension_domain_model_mymodel.php**

```php
<?php

use TYPO3\CMS\Core\Utility\ExtensionManagementUtility;

ExtensionManagementUtility::addTCAcolumns(
  'tx_myextension_domain_model_mymodel',
  [
    'my_link_text' => [
      'label' => 'my_extension.backend_fields:tx_myextension_domain_model_mymodel.my_link_text',
      'config' => [
        'type' => 'text',
        'enableRichtext' => true,
      ],
    ],
  ],
);

ExtensionManagementUtility::addToAllTCAtypes(
  'tx_myextension_domain_model_mymodel',
  'my_link_text',
  'my_content_element',
  'after:bodytext',
);

```

The `field` argument always refers to the database/TCA column name of the
underlying record, even if your Extbase model maps that column to a differently
named property.

Note that Extbase models need to contain all columns that should be rendered
and the record type column (if configured in TCA) for this to work correctly.
For example, an Extbase model that represents `tt_content` must map both `bodytext`
and `ctype` to be able to use `<f:render.text record="{contentModel}" field="bodytext" />`.

For model properties that are not directly mapped to database / TCA fields,
use ViewHelpers like `<f:format.html>{myModel.mySpecialRichText}</f:format.html>`
if formatting is required, or output them directly:
`{record.mySpecialText}` if no formatting is needed.

## Arguments of the `<f:render.text>` ViewHelper

-   **field**

    -   *Type:* string
    -   *Required:* true

    The database field that should be rendered (even if extbase model is used).

-   **optional**

    -   *Type:* boolean
    -   *Default:* false

    If the provided field does not exist in the record, null will be returned.

-   **record**

    -   *Type:* TYPO3\\CMS\\Frontend\\Page\\PageInformation|TYPO3\\CMS\\Core\\Domain\\RecordInterface|TYPO3\\CMS\\Extbase\\DomainObject\\DomainObjectInterface

    A Record API Object or extbase model
