---
title: "Data / getText"
manual: "TypoScript Explained"
version: "main"
permalink: "https://docs.typo3.org/permalink/t3tsref:data-type-gettext@main"
source: "Functions/Data.rst"
rendered: "2026-09-19T06:55:14+00:00"
---

# Data / getText {#data-type-gettext}

The `getText` data type is a kind of tool box for retrieving
values from different sources, for example, `GET`/`POST` variables,
registers, values from the page tree, items in the page menus and records
from database tables.

The general syntax is as follows:

**EXT:site_package/Configuration/Sets/Main/setup.typoscript**

```typoscript
lib.foo.data = <key> : <code>
```

where `<key>` indicates the source and `<code>` contains paths or
pointers to values. Possible keys and codes are described below.

The `code` can contain pipe characters `|` which will
result in a multidimensional array. This, for example, works with `TSFE`:

**EXT:site_package/Configuration/Sets/Main/setup.typoscript**

```typoscript
lib.foo.data = request : frontend.user | username
```

Some codes use a different separator, but this is documented in the
code.
Spaces around the colon (`:`) are irrelevant. The `key` is
case-insensitive.

Using multiple codes separated by a `//` (double slash) will return
the first one that is not empty ("" or zero). The TypoScript below gets the
content of the "header" field. If "header" is empty, "title" is
retrieved. If "title" is also empty, the "uid" field is retrieved:

**EXT:site_package/Configuration/Sets/Main/setup.typoscript**

```typoscript
lib.foo.data = field : header // field : title // field : uid
```

## Properties {#data-type-function-get-text-properties}

-   [applicationcontext](https://docs.typo3.org/permalink/t3tsref:applicationcontext@main)
-   [asset](https://docs.typo3.org/permalink/t3tsref:asset@main)
-   [cObj](https://docs.typo3.org/permalink/t3tsref:cobj@main)
-   [context](https://docs.typo3.org/permalink/t3tsref:context@main)
-   [current](https://docs.typo3.org/permalink/t3tsref:current@main)
-   [date](https://docs.typo3.org/permalink/t3tsref:date@main)
-   [DB](https://docs.typo3.org/permalink/t3tsref:db@main)
-   [debug](https://docs.typo3.org/permalink/t3tsref:debug@main)
-   [field](https://docs.typo3.org/permalink/t3tsref:field@main)
-   [file](https://docs.typo3.org/permalink/t3tsref:file@main)
-   [flexform](https://docs.typo3.org/permalink/t3tsref:flexform@main)
-   [fullRootLine](https://docs.typo3.org/permalink/t3tsref:fullrootline@main)
-   [getenv](https://docs.typo3.org/permalink/t3tsref:getenv@main)
-   [getIndpEnv](https://docs.typo3.org/permalink/t3tsref:getindpenv@main)
-   [global](https://docs.typo3.org/permalink/t3tsref:global@main)
-   [GP](https://docs.typo3.org/permalink/t3tsref:gp@main)
-   [level](https://docs.typo3.org/permalink/t3tsref:level@main)
-   [levelfield](https://docs.typo3.org/permalink/t3tsref:levelfield@main)
-   [levelmedia](https://docs.typo3.org/permalink/t3tsref:levelmedia@main)
-   [leveltitle](https://docs.typo3.org/permalink/t3tsref:leveltitle@main)
-   [leveluid](https://docs.typo3.org/permalink/t3tsref:leveluid@main)
-   [LLL](https://docs.typo3.org/permalink/t3tsref:lll@main)
-   [page](https://docs.typo3.org/permalink/t3tsref:page@main)
-   [pagelayout](https://docs.typo3.org/permalink/t3tsref:pagelayout@main)
-   [parameters](https://docs.typo3.org/permalink/t3tsref:parameters@main)
-   [path](https://docs.typo3.org/permalink/t3tsref:path@main)
-   [register](https://docs.typo3.org/permalink/t3tsref:register@main)
-   [request](https://docs.typo3.org/permalink/t3tsref:request@main)
-   [session](https://docs.typo3.org/permalink/t3tsref:session@main)
-   [site](https://docs.typo3.org/permalink/t3tsref:site@main)
-   [siteLanguage](https://docs.typo3.org/permalink/t3tsref:sitelanguage@main)
-   [siteSettings](https://docs.typo3.org/permalink/t3tsref:sitesettings@main)

### applicationcontext {#data-type-gettext-applicationcontext}

-   **applicationcontext**

    Returns the current [application context](https://docs.typo3.org/m/typo3/reference-coreapi/main/en-us/Administration/SystemSettings/ApplicationContext/Index.html#application-context)
    as a string.

#### Example: Evaluate the current application context {#data-type-gettext-applicationcontext-example}

Evaluate if the current application context is "Production":

**EXT:site_package/Configuration/Sets/Main/setup.typoscript**

```typoscript
if {
  value.data = applicationcontext
  equals = Production
}

```

### asset {#data-type-gettext-asset}

-   **asset**

    The getText `asset` function includes assets like images, CSS or
    JavaScript that are cache-busted.

    Depending on [$GLOBALS\['TYPO3_CONF_VARS'\]\['FE'\]\['versionNumberInFilename'\]](https://docs.typo3.org/m/typo3/reference-coreapi/main/en-us/Configuration/Typo3ConfVars/FE.html#confval-typo3-conf-vars-fe-versionnumberinfilename)
    the cache buster is applied as a query string or embedded in the filename.

    The result is the same as using the argument `useCacheBusting="true"`
    in [Uri.resource ViewHelper \<f:uri.resource>](https://docs.typo3.org/other/typo3/view-helper-reference/main/en-us/Global/Uri/Resource.html#typo3-fluid-uri-resource).

#### Example: Display extension icon with cache buster {#data-type-gettext-asset-example-display-extension}

**EXT:my_extension/Configuration/Sets/Main/setup.typoscript**

```typoscript
page.20 = TEXT
page.20 {
  value.stdWrap.data = asset: EXT:core/Resources/Public/Icons/Extension.svg
}

```

### cObj {#data-type-gettext-cobj-example}

-   **cObj**

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

    See Deprecation: #109575 - Various ContentObjectRenderer properties/methods

#### Example: Get the number of the current cObject record {#data-type-gettext-cobj-example-get-number}

**EXT:site_package/Configuration/Sets/Main/setup.typoscript**

```typoscript
lib.foo.data = cObj : parentRecordNumber
```

### context {#data-type-gettext-context}

-   **context**

    Access values from context API ([see](https://docs.typo3.org/m/typo3/reference-coreapi/main/en-us/ApiOverview/Context/Index.html#context-api)).
    If a property is an array, it is converted into a comma-separated list.

    Syntax:

    **TypoScript Syntax**

    ```none
    lib.foo.data = context:<aspectName>:<propertyName>
    ```

#### Example: Retrieve current workspace ID {#data-type-gettext-context-example}

**EXT:site_package/Configuration/Sets/Main/setup.typoscript**

```typoscript
page.10 = TEXT
page.10.data = context:workspace:id
page.10.wrap = You are in workspace: |
```

### current {#data-type-gettext-current}

-   **current**

    Current (gets the "current" value)

#### Example: Get the current value {#data-type-gettext-current-example-get-current}

**EXT:site_package/Configuration/Sets/Main/setup.typoscript**

```typoscript
lib.foo.data = current
```

### date {#data-type-gettext-date}

-   **date**

    -   *Default:* `d/m Y`

    Can be used with a colon and [date-conf](https://docs.typo3.org/permalink/t3tsref:data-type-date-conf@main).

#### Example:  Get the current time formatted dd-mm-yy {#data-type-gettext-date-example}

**EXT:site_package/Configuration/Sets/Main/setup.typoscript**

```typoscript
lib.foo.data = date : d-m-y
```

### DB {#data-type-gettext-db}

-   **DB**

    -   *Syntax:* DB : \[table name\] : \[uid\] : \[field\]

    Value from the database. Any record from any table that is in the TCA can be
    selected here. Records marked as deleted will not return a value.

    In contrast to the other keys, colons are used here instead of pipes to drill down into the
    structure.

#### Example: Get a header field value of a record {#data-type-gettext-db-example}

Get the value of the header field of record with uid 234 from table
`tt_content`:

**EXT:site_package/Configuration/Sets/Main/setup.typoscript**

```typoscript
lib.foo.data = DB : tt_content:234:header
```

Get the value of the header field of a record, where the uid is in the
`myContentId` GET parameter :

**EXT:site_package/Configuration/Sets/Main/setup.typoscript**

```typoscript
lib.foo.data.dataWrap = DB : tt_content:{GP : myContentId}:header
lib.foo.data.wrap3 = {|}
lib.foo.data.insertData = 1
```

> [!NOTE]
> It is safe to use client-/user-provided input for the id of a DB
> record here. The function `ContentObjectRenderer->getData()` internally
> calls the function `PageRepository->getRawRecord()`, which converts the
> parameter to an int via `QueryBuilder->createNamedParameter()`

### debug {#data-type-gettext-debug}

-   **debug**

    Returns HTML-formatted content of a PHP variable.
    Available variables are `rootLine`, `fullRootLine`, `data`,
    `register` and `page`.

#### Example: Debug the current root-line {#data-type-gettext-debug-example}

Outputs the current root-line visually in HTML:

**EXT:site_package/Configuration/Sets/Main/setup.typoscript**

```typoscript
lib.foo.data = debug : rootLine
```

### field {#data-type-gettext-field}

-   **field**

    -   *Syntax:* field : \[a field name in the current `$cObj->data` array in the cObject, multidimensional\]

    This gives read access to the value of an internal global variable depending on the key.

    -   By default, the `$cObj->data` array is the record of the current page.
    -   In [TMENU](https://docs.typo3.org/permalink/t3tsref:tmenu@main) `$cObj->data` is set to the page-record of
        each menu item in loop iterations during the rendering process.
    -   In [CONTENT](https://docs.typo3.org/permalink/t3tsref:cobj-content@main) / [RECORDS](https://docs.typo3.org/permalink/t3tsref:cobj-records@main) `$cObj->data` is set to
        the current record
    -   In [GIFBUILDER](https://docs.typo3.org/permalink/t3tsref:gifbuilder@main) `$cObj->data` is set to the data
        [GIFBUILDER](https://docs.typo3.org/permalink/t3tsref:gifbuilder@main) is supplied with.

#### Example: Get header data {#data-type-gettext-field-example}

Get content from `$cObj->data['header']`:

**EXT:site_package/Configuration/Sets/Main/setup.typoscript**

```typoscript
lib.foo.data = field : header
```

#### Example: Get data in a field {#data-type-gettext-field-example-get-data}

Get content from `$cObj->data['fieldname']['level1']['level2']`:

**EXT:site_package/Configuration/Sets/Main/setup.typoscript**

```typoscript
lib.foo.data = field : fieldname | level1 | level2
```

### file {#data-type-gettext-file}

-   **file**

    -   *Syntax:* file : \[uid\] : \[property\]

    Retrieves a property from a file object ([FAL](https://docs.typo3.org/m/typo3/reference-coreapi/main/en-us/ApiOverview/Fal/Index.html#fal)) by identifying it through its
    `sys_file` UID. Note that during execution of the [FILES](https://docs.typo3.org/permalink/t3tsref:cobj-files@main) cObject,
    it is possible to reference the current file using [current](https://docs.typo3.org/permalink/t3tsref:confval-data-current@main) as the UID,
    for example, `file : current : size`.

    The following properties are available: name, uid, originalUid, size, sha1,
    extension, mimetype, contents, publicUrl, modification_date and creation_date.

    Furthermore, when manipulating references (such as images in content elements
    and media on pages), these additional properties are available (not all are
    available all the time, it depends on the setup of *references* of the
    [FILES](https://docs.typo3.org/permalink/t3tsref:cobj-files@main) cObject): title, description, link and alternative.

    Any data in the `sys_file_metadata` table can also be accessed.

    See the [FILES](https://docs.typo3.org/permalink/t3tsref:cobj-files-examples@main) cObject for examples of usage.

#### Example: Get the size of a file {#data-type-gettext-file-example}

Get the size of the file with sys_file UID 17:

**EXT:site_package/Configuration/Sets/Main/setup.typoscript**

```typoscript
lib.foo.data = file : 17 : size
```

### flexform {#data-type-gettext-flexform}

-   **flexform**

    -   *Syntax:* flexform : \[field containing flexform data\] : \[property of this flexform\]

    Access values in [FlexForms](https://docs.typo3.org/m/typo3/reference-coreapi/main/en-us/ApiOverview/FlexForms/Index.html#flexforms), for example, inside a `tt_content` record.

#### Example: Get a FlexForm value {#data-type-gettext-flexform-example}

Return the FlexForm value of given name:

**EXT:site_package/Configuration/Sets/Main/setup.typoscript**

```typoscript
lib.foo.data = flexform : pi_flexform:settings.categories
```

### fullRootLine {#data-type-gettext-fullrootline}

-   **fullRootLine**

    -   *Syntax:* fullRootLine : \[pointer, integer\], \[field name\], \["slide"\]

Gets the value of a field of a page in the root line. The *pointer* is an
absolute level, counted from the root page of the site downwards:
`0` addresses the root page itself, `1` the page below
it and so on. The numbers in square brackets indicate which page each value of
*pointer* would point to:

```text
- Site root (root template here!) [0]
  |- Products [1]
    |- You are here! [2]
```

A "slide" parameter can be added (like in [levelfield](https://docs.typo3.org/permalink/t3tsref:data-type-gettext-levelfield@main)
property).

> [!NOTE]
> In contrast to [levelfield](https://docs.typo3.org/permalink/t3tsref:data-type-gettext-levelfield@main), a negative *pointer*
> does not count levels up from the current page. It addresses pages above
> the root page of the site, and TYPO3 does not deliver content from outside
> the current site, so the result is empty. Use
> [levelfield](https://docs.typo3.org/permalink/t3tsref:data-type-gettext-levelfield@main) to count levels up from the current
> page.

#### Example: Get a field from a page in the root line {#data-type-gettext-fullrootline-example}

Get the value of the field `tx_myextension_myfield` from the root page of
the site:

**EXT:my_extension/Configuration/Sets/Main/setup.typoscript**

```typoscript
lib.foo.data = fullRootLine : 0, tx_myextension_myfield
```

Get the title of the page on the first level below the root page of the site:

**EXT:site_package/Configuration/Sets/Main/setup.typoscript**

```typoscript
lib.foo.data = fullRootLine : 1, title
```

### getenv {#data-type-gettext-getenv}

-   **getenv**

    Value from PHP environment variables.

    For a cached version of this feature, see [getEnv](https://docs.typo3.org/permalink/t3tsref:getenv@main).

#### Example: Get the HTTP referer {#data-type-gettext-getenv-example}

Get the environment variable `HTTP_REFERER`.

**EXT:site_package/Configuration/Sets/Main/setup.typoscript**

```typoscript
lib.foo.data = getenv : HTTP_REFERER
```

### getIndpEnv {#data-type-gettext-getindpenv}

-   **getIndpEnv**

    -   *Syntax:* getIndpEnv : \<name>

    Returns the value of a *System Environment Variable* denoted by
    *name* regardless of server OS, CGI/MODULE version, etc. The result is
    usually identical to the `$_SERVER` variable. This method is more reliable
    then [getEnv](https://docs.typo3.org/permalink/t3tsref:data-type-gettext-getenv@main).

    Available names:

    | Name | Definition | Example or result |
    | --- | --- | --- |
    | \_ARRAY | Return an array with all available key-value pairs for debugging purposes |  |
    | HTTP_ACCEPT_LANGUAGE | language(s) accepted by client |  |
    | HTTP_HOST | \[host\]\[:\[port\]\] | `example.org:8080` |
    | HTTP_REFERER | \[scheme\]://\[host\]\[:\[port\]\]\[path\] | `https://example.org:8080/typo3/32/temp/phpcheck/index.php/arg1/arg2/arg3/?arg1,arg2,arg3&p1=parameter1&p2[key]=value` |
    | HTTP_USER_AGENT | client user agent |  |
    | PATH_INFO | \[path_info\] | `/arg1/arg2/arg3/` |
    | QUERY_STRING | \[query\] | `arg1,arg2,arg3&p1=parameter1&p2[key]=value` |
    | REMOTE_ADDR | client IP |  |
    | REMOTE_HOST | client host |  |
    | REQUEST_URI | \[path\]?\[query\] | `/typo3/32/temp/phpcheck/index.php/arg1/arg2/arg3/?arg1,arg2,arg3&p1=parameter1&p2[key]=value` |
    | SCRIPT_FILENAME | absolute filename of script |  |
    | SCRIPT_NAME | \[path_script\] | `/typo3/32/temp/phpcheck/[index.php]` |
    | TYPO3_DOCUMENT_ROOT | absolute path of root of documents |  |
    | TYPO3_HOST_ONLY | \[host\] | `example.org` |
    | TYPO3_PORT | \[port\] | `8080` |
    | TYPO3_REQUEST_DIR | \[scheme\]://\[host\]\[:\[port\]\]\[path_dir\] |  |
    | TYPO3_REQUEST_HOST | \[scheme\]://\[host\]\[:\[port\]\] |  |
    | TYPO3_REQUEST_SCRIPT | \[scheme\]://\[host\]\[:\[port\]\]\[path_script\] |  |
    | TYPO3_REQUEST_URL | \[scheme\]://\[host\]\[:\[port\]\]\[path\]?\[query\] |  |
    | TYPO3_REV_PROXY | TRUE if this session runs over a well known proxy |  |
    | TYPO3_SITE_SCRIPT | \[script / Speaking URL\] of the TYPO3 website |  |
    | TYPO3_SITE_URL | \[scheme\]://\[host\]\[:\[port\]\]\[path_dir\] of the TYPO3 website frontend |  |
    | TYPO3_SSL | TRUE if this session uses SSL/TLS (https) |  |

#### Example: Get the remote address {#data-type-gettext-getindpenv-example}

**EXT:site_package/Configuration/Sets/Main/setup.typoscript**

```typoscript
# get and output the client IP
page = PAGE
page.10 = TEXT
page.10.stdWrap.data = getIndpEnv : REMOTE_ADDR
page.10.stdWrap.htmlSpecialChars = 1

```

### global {#data-type-gettext-global}

-   **global**

    -   *Syntax:* global : \[variable\]

    Deprecated. Use [GP](https://docs.typo3.org/permalink/t3tsref:data-type-gettext-gp@main) or [getenv](https://docs.typo3.org/permalink/t3tsref:data-type-gettext-getenv@main).

### GP {#data-type-gettext-gp}

-   **GP**

    -   *Syntax:* GP : \[Value from GET or POST method\]

    Get a variable from `$_GET` or `$_POST` when a variable, which
    exists in both arrays, is returned from `$_POST`.

#### Example: Get the input value from query string {#data-type-gettext-gp-example}

Get input value from query string `&stuff=...`

**EXT:site_package/Configuration/Sets/Main/setup.typoscript**

```typoscript
lib.foo.data = GP : stuff
```

Get input value from query string `&stuff[bar]=...`

**EXT:site_package/Configuration/Sets/Main/setup.typoscript**

```typoscript
lib.foo.data = GP : stuff | bar
```

### level {#data-type-gettext-level}

-   **level**

    Get the root line level of the current page.

#### Example: Get the root line level of the current page {#data-type-gettext-level-example}

**EXT:site_package/Configuration/Sets/Main/setup.typoscript**

```typoscript
lib.foo.data = level
```

### levelfield {#data-type-gettext-levelfield}

-   **levelfield**

    -   *Syntax:* levelfield : \[pointer, integer\], \[field name\], \["slide"\]

    Like [leveltitle](https://docs.typo3.org/permalink/t3tsref:data-type-gettext-leveltitle@main) but you can choose which field should
    be fetched from the record.

#### Example: Get a field from a page up the root-line {#data-type-gettext-levelfield-example}

Get the value of user-defined field `tx_myextension_myfield` in the root line.

**EXT:my_extension/Configuration/Sets/Main/setup.typoscript**

```typoscript
lib.foo.data = levelfield : -1, tx_myextension_myfield, slide
```

### levelmedia {#data-type-gettext-levelmedia}

-   **levelmedia**

    -   *Syntax:* levelmedia : \[pointer, integer\], \["slide"\]

    Get the media field of a page in the root-line.

    -   Use an absolute level: 0 or a positive integer.
    -   Negative integers determine x levels up.
    -   The slide parameter slides until there is a non-empty value.

### leveltitle {#data-type-gettext-leveltitle}

-   **leveltitle**

    -   *Syntax:* leveltitle : \[pointer, integer\], \["slide"\]

    Get the title of a page in the root-line.

    -   Use an absolute level: 0 or a positive integer.
    -   Negative integers determine x levels up
    -   The slide parameter slides until there is a non-empty value.

#### Example: Get the title of a page up the root line {#data-type-gettext-leveltitle-example-get-title}

Get the title of the page on the first level of the root line:

**EXT:site_package/Configuration/Sets/Main/setup.typoscript**

```typoscript
lib.foo.data = leveltitle : 1
```

Get the title of the page on the level immediately below the current. If
it is empty, walk to the bottom of the root line until there is a
title:

**EXT:site_package/Configuration/Sets/Main/setup.typoscript**

```typoscript
lib.foo.data = leveltitle : -2, slide
```

### leveluid {#data-type-gettext-leveluid}

-   **leveluid**

    -   *Syntax:* leveluid : \[pointer, integer\]

    Get the UID of a page in the root line.

    -   Use an absolute level: 0 or a positive integer.
    -   Negative integers determine x levels up.

#### Example: Get the ID of the root page of the page tree {#data-type-gettext-leveluid-example}

Get the ID of the root page of the website (level zero):

**EXT:site_package/Configuration/Sets/Main/setup.typoscript**

```typoscript
lib.foo.data = leveluid : 0
```

### LLL {#data-type-gettext-lll}

-   **LLL**

    -   *Syntax:* LLL: \[fileref\]:\[labelkey\]

    Reference to a locallang label ([XLIFF](https://docs.typo3.org/m/typo3/reference-coreapi/main/en-us/ApiOverview/Localization/XliffFormat.html#xliff)). Reference consists of
    \[fileref\]:\[labelkey\]

#### Example: Get a localized label {#data-type-gettext-lll-example-get-localized}

Get the localized label for the logout button:

**EXT:site_package/Configuration/Sets/Main/setup.typoscript**

```typoscript
lib.foo.data = LLL : EXT:felogin/Resources/Private/Language/locallang.xlf:logout
```

### page {#data-type-gettext-page}

-   **page**

    -   *Syntax:* page: \[field in the current page record\]

    Get the specified field from the current page

#### Example: Get the current page title {#data-type-gettext-page-example}

**EXT:site_package/Configuration/Sets/Main/setup.typoscript**

```typoscript
lib.foo.data = page : title
```

### pagelayout {#data-type-gettext-pagelayout}

-   **pagelayout**

    Get the current backend layout.

#### Example: Get the current backend layout {#data-type-gettext-pagelayout-example}

**EXT:site_package/Configuration/Sets/Main/setup.typoscript**

```typoscript
lib.foo.data = pagelayout
```

### parameters {#data-type-gettext-parameters}

-   **parameters**

    -   *Syntax:* parameters: \[field name from the current `$cObj->parameters` array in the cObject.\]

    Get the content of a key in the `parameters` array of the current cObject.

#### Example: Get the parameter `color` {#data-type-gettext-parameters-examples}

Get content from `$cObj->parameters['color']`:

**EXT:site_package/Configuration/Sets/Main/setup.typoscript**

```typoscript
lib.foo.data = parameters : color
```

### path {#data-type-gettext-path}

-   **path**

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

    path returns an absolute URL.Path to a file, for example, that is in an extension. Returns an empty value if the file
    does not exist.

    **EXT:my_extension/Configuration/Sets/Main/setup.typoscript**

    ```typoscript
    page.20 = TEXT
    page.20 {
      data = path : EXT:core/Resources/Public/Icons/Extension.svg
    }
    # Returns /typo3/sysext/core/Resources/Public/Icons/Extension.svg

    ```

#### Example: Resolve the path to a file {#data-type-gettext-path-example}

Get path to file `rsaauth.js` (inside extension rsaauth) relative to siteroot:

**EXT:site_package/Configuration/Sets/Main/setup.typoscript**

```typoscript
lib.foo.data = path : EXT:rsaauth/resources/rsaauth.js
```

It can also be helpful in combination with the stdWrap function
[](https://docs.typo3.org/permalink/t3tsref:stdwrap-insertdata@main):

**EXT:site_package/Configuration/Sets/Main/setup.typoscript**

```typoscript
page.headerData.10 = TEXT
page.headerData.10 {
  data = path : EXT:site/Resources/Public/Images/logo.png
  wrap = <a href="|">
}

```

### register {#data-type-gettext-register}

-   **register**

    -   *Syntax:* register: \[field name from the register stack\]

    See [LOAD_REGISTER](https://docs.typo3.org/permalink/t3tsref:cobj-load-register@main).

#### Example: Get the content of a register {#data-type-gettext-register-example}

Get content from a [register](https://docs.typo3.org/permalink/t3tsref:using-setting-register@main):

**EXT:site_package/Configuration/Sets/Main/setup.typoscript**

```typoscript
lib.foo.data = register : color
```

### request {#data-type-gettext-request}

-   **request**

    -   *Syntax:* request : \[attribute\] | \[property\] ( | \[subproperty\] | ... )

    Retrieve the property of a
    [PSR-7 request attribute](https://docs.typo3.org/m/typo3/reference-coreapi/main/en-us/ApiOverview/RequestLifeCycle/RequestAttributes/Index.html#request-attributes).

    Only scalar properties can be retrieved: int, float, string or
    bool values. If the property is an object or an array, a subproperty can
    be used to call the getter method of the object or retrieve the
    key of the array.

#### Example: Get the page type {#data-type-gettext-request-example-page-type}

**EXT:site_package/Configuration/Sets/Main/setup.typoscript**

```typoscript
lib.foo.data = request : routing | pageType
```

#### Example: Get a query argument {#data-type-gettext-request-example-queryarguments}

**EXT:site_package/Configuration/Sets/Main/setup.typoscript**

```typoscript
# Retrieve the value of the query parameter ?myParam=<value>
lib.foo.data = request : routing | queryArguments | myParam

# Retrieve the value of the query parameter ?tx_myext[key]=<value>
lib.foo.data = request : routing | queryArguments | tx_myext | key

```

#### Example: Get the nonce {#data-type-gettext-request-example-nonce}

**EXT:site_package/Configuration/Sets/Main/setup.typoscript**

```typoscript
lib.foo.data = request : nonce | value
```

### session {#data-type-gettext-session}

-   **session**

    -   *Syntax:* session : \[key\]

    The `key` is the session key used to store a value.

#### Example: Get a value stored in the current session {#data-type-gettext-session-example}

Get the number of items of a stored shopping cart array/object:

**EXT:site_package/Configuration/Sets/Main/setup.typoscript**

```typoscript
lib.foo.data = session : shop_cart | itemCount
```

### site {#data-type-site}

-   **site**

    -   *Syntax:* site : \[key\]

    Accesses the current
    [site configuration](https://docs.typo3.org/m/typo3/reference-coreapi/main/en-us/ApiOverview/SiteHandling/Basics.html#sitehandling-basics).

    **Possible keys:**

    -   **`attributes`**

        Additional parameters configured for this site.

    -   **`base`**

        The base URL for this site.

    -   **`baseVariants`**

        The base variants of this site.

    -   **`rootPageId`**

        The root page ID of this site.

    -   **`identifier`**

        The identifier (name) of this site configuration.

    -   **`websiteTitle`**

        The website title of this site.

#### Example: Get values from the current site {#data-type-site-example}

**EXT:site_package/Configuration/Sets/Main/setup.typoscript**

```typoscript
page.10 = TEXT
page.10.data = site:base
page.10.wrap = This is your base URL: |
```

`site` is the keyword, and the parts after the colon are the
configuration key(s) to access.

**EXT:site_package/Configuration/Sets/Main/setup.typoscript**

```typoscript
page.10 = TEXT
page.10.data = site:customConfigKey.nested.value
```

### siteLanguage {#data-type-sitelanguage}

-   **siteLanguage**

    -   *Syntax:* siteLanguage : \[key\]

    Accesses the current
    [site language configuration](https://docs.typo3.org/m/typo3/reference-coreapi/main/en-us/ApiOverview/SiteHandling/AddLanguages.html#sitehandling-addingLanguages).

    **Possible keys:**

    -   **`attributes`**

        Additional parameters configured for this site language.

    -   **`base`**

        The base URL for this language.

    -   **`flagIdentifier`**

        The flag key (for example, `gb` or `fr`) used in the TYPO3 backend.

        `flag` can be used to match the site
        configuration setting.

    -   **`hreflang`**

        The language tag for this language defined by RFC 1766 / 3066
        `hreflang` attributes.

        This option is not relevant for regular websites without
        rendering hreflang tag.

    -   **`languageId`**

        The language mapped to the ID of the site language.

    -   **`locale`**

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

        The locale property in typoscript can be subdivided
        using subkeys separated by a colon :.
        The subkeys languageCode, countryCode, and full allow access
        to the individual components of the locale value. For
        instance, a locale value of "en_US.UTF-8" can be
        broken down into "en", "US", and for the full subkey, "en-US".languageCode: this contains the two-letter
        language code (previously
        siteLanguage:twoLetterIsoCode)countryCode: contains the uppercase country code
        part of the localefull: contains the entire locale (this is also the default
        if no subkey is specified)The `locale` property represents the language, country, and
        character encoding settings for TYPO3. It is a composite value, such as
        "en_US.UTF-8", which can be dissected into different components via
        subkeys for more precise language and location specifications.

    -   **`navigationTitle`**

        The label used in language menus.

    -   **`title`**

        The label used in TYPO3 to identify the language.

    -   **`typo3Language`**

        The prefix for TYPO3's language files (`default` for English), otherwise
        one of TYPO3's internal language keys. Previously configured via
        TypoScript `config.language = fr`.

    -   **`websiteTitle`**

        The website title for this language. Note: there is no automatic fallback to the
        `site:websiteTitle`.

#### Example: Get values from the current site language {#data-type-sitelanguage-example}

**EXT:site_package/Configuration/Sets/Main/setup.typoscript**

```typoscript
page.10 = TEXT
page.10.data = siteLanguage:navigationTitle
page.10.wrap = This is the title of the current site language: |

page.20 = TEXT
page.20.dataWrap = The current site language's locale is {siteLanguage:locale}

# Website title for the current language with fallback
# to the website title of the site configuration.
page.30 = TEXT
page.30.data = siteLanguage:websiteTitle // site:websiteTitle

```

### siteSettings {#data-type-sitesettings}

-   **siteSettings**

    Access the [site settings](https://docs.typo3.org/m/typo3/reference-coreapi/main/en-us/ApiOverview/SiteHandling/SiteSettings.html#sitehandling-settings) of the
    current site.

#### Example: Access the redirects HTTP status code {#data-type-sitesettings-example}

**EXT:site_package/Configuration/Sets/Main/setup.typoscript**

```typoscript
page.10 = TEXT
page.10.data = siteSettings:redirects.httpStatusCode
```
