---
title: "FLUIDTEMPLATE"
manual: "TypoScript Explained"
version: "13.4"
permalink: "https://docs.typo3.org/permalink/t3tsref:cobj-template@13.4"
source: "ContentObjects/Fluidtemplate/Index.rst"
rendered: "2026-09-19T07:15:48+00:00"
---

# FLUIDTEMPLATE {#cobj-template}

An object of type `FLUIDTEMPLATE` combines TypoScript with the Fluid
templating engine.

A `FLUIDTEMPLATE` object generates content using [Fluid](https://docs.typo3.org/m/typo3/reference-coreapi/13.4/en-us/ApiOverview/Fluid/Index.html#fluid) templates.
It can be used in [content elements](https://docs.typo3.org/m/typo3/reference-coreapi/13.4/en-us/ApiOverview/ContentElements/AddingYourOwnContentElements.html#adding-your-own-content-elements)
or to generate content in the top-level page object
(see [the example on this page](https://docs.typo3.org/permalink/t3tsref:cobj-fluidtemplate-examples@13.4)).

<!-- TODO: no Markdown rendering for "versionadded" -->

Starting with TYPO3 v13.1 you can use the
PAGEVIEW content object for templates on page-level.
It reduces the amount of TypoScript needed to render a page in the TYPO3 frontend.See section Migration from FLUIDTEMPLATE to PAGEVIEW.

**Table of content**

-   [Data available in Fluid templates](https://docs.typo3.org/permalink/t3tsref:data-available-in-fluid-templates@13.4)
-   [Properties](https://docs.typo3.org/permalink/t3tsref:properties@13.4)
-   [Example: Usage with RecordTransformationProcessor](https://docs.typo3.org/permalink/t3tsref:example-usage-with-recordtransformationprocessor@13.4)
-   [Example](https://docs.typo3.org/permalink/t3tsref:example@13.4)
-   [Migration from FLUIDTEMPLATE to PAGEVIEW](https://docs.typo3.org/permalink/t3tsref:migration-from-fluidtemplate-to-pageview@13.4)

## Data available in Fluid templates {#cobj-fluidtemplate-data}

<!-- TODO: no Markdown rendering for "versionadded" -->

The FLUIDTEMPLATE can now be used in combination with the
record-transformation data processor for additional computed information.
See also Example: Usage with FLUIDTEMPLATE

The following data is available in the Fluid template:

-   The content of the current `data` array.

    -   At page level it contains the current page record.
    -   If the `FLUIDTEMPLATE` is used in the
        context of the Fluid ViewHelper [CObject ViewHelper \<f:cObject>](https://docs.typo3.org/other/typo3/view-helper-reference/13.4/en-us/Global/CObject.html#typo3-fluid-cobject)
        it contains data in the Fluid Property `data`.
    -   If called in the context of Extbase it contains the data assigned to the view
        in the [Controller](https://docs.typo3.org/m/typo3/reference-coreapi/13.4/en-us/ExtensionArchitecture/Extbase/Reference/Controller/ActionController.html#extbase-action-controller).
    -   Use the [record-transformation data processor](https://docs.typo3.org/permalink/t3tsref:recordtransformationprocessor@13.4) to get additional computed
        information from the `data` array.
-   The `settings` array set by the parameter
    [settings](https://docs.typo3.org/permalink/t3tsref:cobj-fluidtemplate-properties-settings@13.4)
-   Variables in the
    [variables](https://docs.typo3.org/permalink/t3tsref:cobj-fluidtemplate-properties-variables@13.4) setting
-   Data retrieved by
    [data processors](https://docs.typo3.org/permalink/t3tsref:cobj-fluidtemplate-properties-dataprocessing@13.4)

You can use the [debug](https://docs.typo3.org/other/typo3/view-helper-reference/13.4/en-us/Global/Debug.html#typo3-fluid-debug) ViewHelper
to output all available data using the magic `{_all}` variable:

```html
<f:debug>{_all}</f:debug>
```

## Properties {#cobj-fluidtemplate-properties}

### cache {#cobj-fluidtemplate-cache}

-   **cache**

    -   *Type:* [cache](https://docs.typo3.org/permalink/t3tsref:cache@13.4)

    See [cache function description](https://docs.typo3.org/permalink/t3tsref:cache@13.4) for details.

### dataProcessing {#fluidtemplate-dataprocessing}

-   **dataProcessing**

    -   *Type:* array of class references by full namespace

    Add one or more processors to manipulate the `$data` variable of
    the currently rendered content object, such as tt_content or page. Use the
    sub-property `options` to pass parameters to the
    processor class.

    > [!NOTE]
    > This content was moved to the subpage [Data processors](https://docs.typo3.org/permalink/t3tsref:dataprocessing@13.4).

### extbase.controllerActionName {#cobj-fluidtemplate-properties-extbase-controlleractionname}

-   **extbase.controllerActionName**

    -   *Type:* [string](https://docs.typo3.org/permalink/t3tsref:data-type-string@13.4) / [stdWrap](https://docs.typo3.org/permalink/t3tsref:stdwrap@13.4)

    Sets the name of the action.

### extbase.controllerExtensionName {#cobj-fluidtemplate-properties-extbase-controllerextensionname}

-   **extbase.controllerExtensionName**

    -   *Type:* [string](https://docs.typo3.org/permalink/t3tsref:data-type-string@13.4) / [stdWrap](https://docs.typo3.org/permalink/t3tsref:stdwrap@13.4)

    Sets the extension name of the controller.

### extbase.controllerName {#cobj-fluidtemplate-properties-extbase-controllername}

-   **extbase.controllerName**

    -   *Type:* [string](https://docs.typo3.org/permalink/t3tsref:data-type-string@13.4) / [stdWrap](https://docs.typo3.org/permalink/t3tsref:stdwrap@13.4)

    Sets the name of the controller.

### extbase.pluginName {#cobj-fluidtemplate-properties-extbase-pluginname}

-   **extbase.pluginName**

    -   *Type:* [string](https://docs.typo3.org/permalink/t3tsref:data-type-string@13.4) / [stdWrap](https://docs.typo3.org/permalink/t3tsref:stdwrap@13.4)

    Sets variables for initializing extbase.

### file {#cobj-fluidtemplate-properties-file}

-   **file**

    -   *Type:* [string](https://docs.typo3.org/permalink/t3tsref:data-type-string@13.4) / [stdWrap](https://docs.typo3.org/permalink/t3tsref:stdwrap@13.4)

    The fluid template file. It is an alternative to ".template" and is used
    only if ".template" is not set.

    **Example**

    **EXT:my_sitepackage/Configuration/TypoScript/setup.typoscript**

    ```typoscript
    page = PAGE
    page {
      10 = FLUIDTEMPLATE
      10 {
        file = EXT:my_sitepackage/Resources/Private/Templates/Page/MyTemplate.html
      }
    }

    ```

### format {#cobj-fluidtemplate-properties-format}

-   **format**

    -   *Type:* keyword / [stdWrap](https://docs.typo3.org/permalink/t3tsref:stdwrap@13.4)
    -   *Default:* html

    `format` sets the format of the current request. It can be something
    like "html", "xml", "png", "json" or even "rss.xml" or something similar.

### layoutRootPath {#cobj-fluidtemplate-properties-layoutrootpath}

-   **layoutRootPath**

    -   *Type:* [path](https://docs.typo3.org/permalink/t3tsref:data-type-path@13.4) / [stdWrap](https://docs.typo3.org/permalink/t3tsref:stdwrap@13.4)

    Sets a specific layout path, usually
    `EXT:my_extension/Resources/Private/Layouts/` or a folder below that
    path.

    > [!NOTE]
    > It is recommended to use
    > [layoutRootPaths](https://docs.typo3.org/permalink/t3tsref:cobj-fluidtemplate-properties-layoutrootpaths@13.4) (note the
    > plural "s") as it can easily be extended by custom templates in the
    > sitepackage.

### layoutRootPaths {#cobj-fluidtemplate-properties-layoutrootpaths}

-   **layoutRootPaths**

    -   *Type:* array of [path](https://docs.typo3.org/permalink/t3tsref:data-type-path@13.4) with [stdWrap](https://docs.typo3.org/permalink/t3tsref:stdwrap@13.4)

    > [!NOTE]
    > Note the plural -s in "layoutRootPaths"!

    > [!NOTE]
    > If you want to extend layoutRootPaths conditionally, best practice
    > is to use [Conditions](https://docs.typo3.org/permalink/t3tsref:conditions@13.4) instead of the ["if" function](https://docs.typo3.org/permalink/t3tsref:if@13.4).

    Used to define several paths for layouts, which will be tried in reversed
    order (the paths are searched from bottom to top). The first folder where
    the desired layout is found is used. If the array keys are numeric, they
    are first sorted and then tried in reversed order.

    **Example**

    **EXT:my_sitepackage/Configuration/TypoScript/setup.typoscript**

    ```typoscript
    page = PAGE
    page {
      10 = FLUIDTEMPLATE
      10 {
        file = EXT:my_sitepackage/Resources/Private/Templates/Main.html
        layoutRootPaths {
          10 = EXT:my_base_sitepackage/Resources/Private/Layouts
          20 = EXT:my_sitepackage/Resources/Private/Layouts
        }
      }
    }

    ```

    If property
    [layoutRootPath](https://docs.typo3.org/permalink/t3tsref:cobj-fluidtemplate-properties-layoutrootpath@13.4)
    (singular) is also used, it will be placed as the first option
    in the list of fall back paths.

### partialRootPath {#cobj-fluidtemplate-properties-partialrootpath}

-   **partialRootPath**

    -   *Type:* [path](https://docs.typo3.org/permalink/t3tsref:data-type-path@13.4) / [stdWrap](https://docs.typo3.org/permalink/t3tsref:stdwrap@13.4)

    Sets a specific partial path, usually
    `EXT:my_extension/Resources/Private/Partials/` or a folder below that
    path.

    > [!NOTE]
    > It is recommended to use
    > [partialRootPaths](https://docs.typo3.org/permalink/t3tsref:cobj-fluidtemplate-properties-partialrootpaths@13.4) (note the
    > plural "s") as it can be easily extended by custom templates provided
    > by the sitepackage.

### partialRootPaths {#cobj-fluidtemplate-properties-partialrootpaths}

-   **partialRootPaths**

    -   *Type:* array of [path](https://docs.typo3.org/permalink/t3tsref:data-type-path@13.4) with [stdWrap](https://docs.typo3.org/permalink/t3tsref:stdwrap@13.4)

    > [!NOTE]
    > Note the plural -s in "partialRootPaths"!

    > [!NOTE]
    > If you want to extend partialRootPaths conditionally, best practice
    > is to use [Conditions](https://docs.typo3.org/permalink/t3tsref:conditions@13.4) instead of the ["if" function](https://docs.typo3.org/permalink/t3tsref:if@13.4).

    Used to define several paths for partials, which will be tried in reverse
    order. The first folder where the desired partial is found is used. The
    keys of the array define the order.

    See [layoutRootPaths](https://docs.typo3.org/permalink/t3tsref:cobj-fluidtemplate-properties-layoutrootpaths@13.4)
    for more details.

### settings {#cobj-fluidtemplate-properties-settings}

-   **settings**

    -   *Type:* array of keys

    Sets the settings array in the fluid template. The value
    can then be used in the view.

    **Example**

    **EXT:site_package/Configuration/TypoScript/setup.typoscript**

    ```typoscript
    page = PAGE
    page {
      10 = FLUIDTEMPLATE
      10 {
        file = EXT:site_default/Resources/Private/Templates/MyTemplate.html
        settings {
          copyrightYear = 2013
        }
      }
    }

    ```

    To access copyrightYear in the template file use:

    ```html
    {settings.copyrightYear}
    ```

    Apart from setting a key-value pair as in the example, you can
    also reference objects or access constants.

### stdWrap {#cobj-fluidtemplate-properties-stdwrap}

-   **stdWrap**

    -   *Type:* [->stdWrap](https://docs.typo3.org/permalink/t3tsref:stdwrap@13.4)

    Provides the usual stdWrap functionality.

### template {#cobj-fluidtemplate-properties-template}

-   **template**

    -   *Type:* [cObject](https://docs.typo3.org/permalink/t3tsref:data-type-cobject@13.4)

    Use this property to define the content object which should be used as
    a template file. It is an alternative to ".file"; if ".template" is set, it
    takes precedence.

### templateName {#cobj-fluidtemplate-properties-templatename}

-   **templateName**

    -   *Type:* [string](https://docs.typo3.org/permalink/t3tsref:data-type-string@13.4) / [stdWrap](https://docs.typo3.org/permalink/t3tsref:stdwrap@13.4)

    This name is used together with the set format to find the template in the
    templateRootPaths. Use this property to define a content object to use
    as a template file. It is an alternative to `.file`. If
    `.templateName` is set, it takes precedence.

    **Example 1**

    **EXT:site_package/Configuration/TypoScript/setup.typoscript**

    ```typoscript
    lib.stdContent = FLUIDTEMPLATE
    lib.stdContent {
      templateName = Default
      layoutRootPaths {
        10 = EXT:frontend/Resources/Private/Layouts
        20 = EXT:sitemodification/Resources/Private/Layouts
      }
      partialRootPaths {
        10 = EXT:frontend/Resources/Private/Partials
        20 = EXT:sitemodification/Resources/Private/Partials
      }
      templateRootPaths {
        10 = EXT:frontend/Resources/Private/Templates
        20 = EXT:sitemodification/Resources/Private/Templates
      }
      variables {
        foo = TEXT
        foo.value = bar
      }
    }

    ```

    **Example 2**

    **EXT:site_package/Configuration/TypoScript/setup.typoscript**

    ```typoscript
    lib.stdContent = FLUIDTEMPLATE
    lib.stdContent {
      templateName {
        cObject = TEXT
        cObject {
          data = levelfield:-2,backend_layout_next_level,slide
          override.field = backend_layout
          split {
            token = frontend__
            1.current = 1
            1.wrap = |
          }
        }
        ifEmpty = Default
      }
      layoutRootPaths {
        10 = EXT:frontend/Resources/Private/Layouts
        20 = EXT:sitemodification/Resources/Private/Layouts
      }
      partialRootPaths {
        10 = EXT:frontend/Resources/Private/Partials
        20 = EXT:sitemodification/Resources/Private/Partials
      }
      templateRootPaths {
        10 = EXT:frontend/Resources/Private/Templates
        20 = EXT:sitemodification/Resources/Private/Templates
      }
      variables {
        foo = bar
      }
    }

    ```

### templateRootPath {#cobj-fluidtemplate-properties-templaterootpath}

-   **templateRootPath**

    -   *Type:* file path /[stdWrap](https://docs.typo3.org/permalink/t3tsref:stdwrap@13.4)

    Sets a specific template path, usually
    `EXT:my_extension/Resources/Private/Templates/` or a folder below that
    path.

    > [!NOTE]
    > It is recommended to use
    > [templateRootPaths](https://docs.typo3.org/permalink/t3tsref:cobj-fluidtemplate-properties-templaterootpaths@13.4) (note the
    > plural "s") as it can be easily extended by custom templates provided
    > by the sitepackage.

### templateRootPaths {#cobj-fluidtemplate-properties-templaterootpaths}

-   **templateRootPaths**

    -   *Type:* array of file paths with [stdWrap](https://docs.typo3.org/permalink/t3tsref:stdwrap@13.4)

    > [!NOTE]
    > Note the plural -s in "templateRootPaths"!

    > [!NOTE]
    > If you want to extend templateRootPaths conditionally, best practice
    > is to use [Conditions](https://docs.typo3.org/permalink/t3tsref:conditions@13.4) instead of the ["if" function](https://docs.typo3.org/permalink/t3tsref:if@13.4).

    Used to define several paths for templates, which will be tried in reverse
    order (the paths are searched from bottom to top). The first folder where
    the desired layout is found is used. If the array keys are numeric, they
    are first sorted and then tried in reverse order.

    Useful in combination with the
    [templateName](https://docs.typo3.org/permalink/t3tsref:cobj-fluidtemplate-properties-templatename@13.4) property.

    **Example**

    **EXT:site_package/Configuration/TypoScript/setup.typoscript**

    ```typoscript
    page {
      10 = FLUIDTEMPLATE
      10 {
        templateName = Default
        templateRootPaths {
          10 = EXT:sitedesign/Resources/Private/Templates
          20 = EXT:sitemodification/Resources/Private/Templates
        }
      }
    }

    ```

### variables {#cobj-fluidtemplate-properties-variables}

-   **variables**

    -   *Type:* *(array of cObjects)*

    Sets the variables that will be available in the fluid template. The keys are
    the variable names in Fluid.

    Reserved variables are "data" and "current", which are set automatically
    to the current data set.

## Example: Usage with RecordTransformationProcessor {#cobj-fluidtemplate-example-recordtransformationprocessor}

<!-- TODO: no Markdown rendering for "versionadded" -->

The FLUIDTEMPLATE can now be used in combination with the
record-transformation data processor for additional computed information.

The [record-transformation data processor](https://docs.typo3.org/permalink/t3tsref:recordtransformationprocessor@13.4) transforms the current data array of
the `FLUIDTEMPLATE` to a record object.

This can be used for content elements of
[Fluid Styled Content](https://docs.typo3.org/c/typo3/cms-fluid-styled-content/13.4/en-us/Index.html#start) or
custom ones. In this example the Fluid Styled Content
element "Text" has its data transformed for easier and enhanced usage.

**EXT:my_extension/Configuration/TypoScript/setup.typoscript**

```typoscript
# tt_content.text = FLUIDTEMPLATE
tt_content.text {
  templateName = Text
  dataProcessing {
    10 = record-transformation
  }
}

```

For usage of the variables within Fluid see
[Example: Usage with FLUIDTEMPLATE](https://docs.typo3.org/permalink/t3tsref:recordtransformationprocessor-fluidtemplate-example@13.4).

## Example {#cobj-fluidtemplate-examples}

<!-- TODO: no Markdown rendering for "versionadded" -->

It is recommended to use PAGEVIEW for page templates
starting with TYPO3 v13.1. See
How to migrate to PAGEVIEW

The Fluid template in
`EXT:my_sitepackage/Resources/Private/Templates/MyTemplate.html` could look
like this:

**EXT:my_sitepackage/Resources/Private/Templates/MyTemplate.html**

```html
<h1>{data.title}<f:if condition="{data.subtitle}">, {data.subtitle}</f:if></h1>
<h3>{mylabel}</h3>
<f:format.html>{data.bodytext}</f:format.html>
<p>&copy; {settings.copyrightYear}</p>

```

You could use it with TypoScript code like this:

**Before migration, EXT:my_sitepackage/Configuration/TypoScript/setup.typoscript**

```typoscript
page = PAGE
page.10 = FLUIDTEMPLATE
page.10 {
  templateName = MyTemplate
  templateRootPaths {
    10 = EXT:my_sitepackage/Resources/Private/Templates
  }
  partialRootPaths {
    10 = EXT:my_sitepackage/Resources/Private/Partials
  }
  variables {
    mylabel = TEXT
    mylabel.value = Label coming from TypoScript!
  }
  settings {
    # Get the copyright year from a TypoScript constant.
    copyrightYear = {$year}
  }
}

```

As a result, the page title and the label from TypoScript will be inserted as
titles. The copyright year will be taken from the TypoScript constant
"year".

> [!NOTE]
> **See also**
>
> -   [Data processors](https://docs.typo3.org/permalink/t3tsref:dataprocessing@13.4) examples
> -   [Create a custom content element type](https://docs.typo3.org/m/typo3/reference-coreapi/13.4/en-us/ApiOverview/ContentElements/AddingYourOwnContentElements.html#adding-your-own-content-elements)
> -   [TYPO3 site package tutorial](https://docs.typo3.org/m/typo3/tutorial-sitepackage/13.4/en-us/Index.html#start)

## Migration from `FLUIDTEMPLATE` to `PAGEVIEW` {#cobj-fluidtemplate-migration}

**Before migration, EXT:my_sitepackage/Configuration/TypoScript/setup.typoscript**

```typoscript
page = PAGE
page {
  10 = FLUIDTEMPLATE
  10 {
    templateName = TEXT
    templateName {
      stdWrap {
        cObject = TEXT
        cObject {
          data = levelfield:-2, backend_layout_next_level, slide
          override {
            field = backend_layout
          }

          split {
            token = pagets__
            1 {
              current = 1
              wrap = |
            }
          }
        }

        ifEmpty = Standard
      }
    }

    templateRootPaths {
      100 = EXT:my_sitepackage/Resources/Private/Templates/Pages/
    }

    partialRootPaths {
      100 = EXT:my_sitepackage/Resources/Private/Partials/Pages/
    }

    layoutRootPaths {
      100 = EXT:my_sitepackage/Resources/Private/Layouts/Pages/
    }

    variables {
      pageUid = TEXT
      pageUid.data = page:uid

      pageTitle = TEXT
      pageTitle.data = page:title

      pageSubtitle = TEXT
      pageSubtitle.data = page:subtitle

      parentPageTitle = TEXT
      parentPageTitle.data = levelfield:-1:title
    }

    dataProcessing {
      10 = menu
      10.as = mainMenu
    }
  }
}

```

**After migration, EXT:my_sitepackage/Configuration/TypoScript/setup.typoscript**

```typoscript
page = PAGE
page {
  10 = PAGEVIEW
  10 {
    paths {
      100 = EXT:my_sitepackage/Resources/Private/PageView/
    }
    variables {
      parentPageTitle = TEXT
      parentPageTitle.data = levelfield:-1:title
    }
    dataProcessing {
      10 = menu
      10.as = mainMenu
    }
  }
}

```

In Fluid, the pageUid is available as `{page.uid}` and pageTitle
as `{page.title}`, the subtitle with `{page.subtitle}`.

In this example some Fluid templates have to be moved:

-   **`EXT:my_sitepackage/Resources/Private/Templates/Pages/`**

    Move files to `EXT:my_sitepackage/Resources/Private/PageView/Pages/`

-   **`EXT:my_sitepackage/Resources/Private/Partials/Pages/`**

    Move files to `EXT:my_sitepackage/Resources/Private/PageView/Partials/`

-   **`EXT:my_sitepackage/Resources/Private/Layouts/Pages/`**

    Move files to `EXT:my_sitepackage/Resources/Private/PageView/Layouts/`

If the `Private` folder previously looked like this:

-   `EXT:my_sitepackage/Resources/Private/`
    -   `Languages`
    -   `Layouts`
        -   `Pages`
    -   `Partials`
        -   `Pages`
    -   `Templates`
        -   `Pages`

It should look like this afterwards:

-   `EXT:my_sitepackage/Resources/Private/`
    -   `Languages`
    -   `PageView`
        -   `Layouts`
        -   `Pages`
        -   `Partials`
