---
title: "Using site configuration in conditions"
manual: "TYPO3 Explained"
version: "main"
permalink: "https://docs.typo3.org/permalink/t3coreapi:sitehandling-inconditions@main"
source: "ApiOverview/SiteHandling/UseSiteInConditions.rst"
rendered: "2026-09-24T12:36:55+00:00"
---

# Using site configuration in conditions {#sitehandling-inconditions}

Site configuration may be used in all conditions that use
[Symfony expression language](https://symfony.com/doc/current/components/expression_language.html) via the
[EXT:core/Classes/ExpressionLanguage/FunctionsProvider/Typo3ConditionFunctionsProvider.php (GitHub)](https://github.com/typo3/typo3/blob/main/typo3/sysext/core/Classes/ExpressionLanguage/FunctionsProvider/Typo3ConditionFunctionsProvider.php)
class - at the moment, this means in
[EXT:form variants](https://docs.typo3.org/c/typo3/cms-form/main/en-us/I/Concepts/Variants/Index.html#concepts-variants) and
[TypoScript conditions](https://docs.typo3.org/m/typo3/reference-typoscript/main/en-us/Conditions/Index.html#conditions).

Two objects are available:

-   **`site`**

    You can access the properties of the top level site configuration.

-   **`siteLanguage`**

    Access the configuration of the current site language.

## TypoScript examples {#sitehandling-in-conditions-typoscript-examples}

The identifier of the site name is evaluated:

```typoscript
[site("identifier") == "someIdentifier"]
   page.30.value = foo
[GLOBAL]
```

A custom field is evaluated:

```typoscript
[site("configuration")["custom_field"] == "compareValue"]
   page.35.value = abc
[GLOBAL]
```

`site("methodName")` is equivalent to a call of "methodName" on the current site object.

You can take a look at `\TYPO3\CMS\Core\Site\Entity\SiteInterface` for accessible methods.

Property of the current site language is evaluated:

```typoscript
[siteLanguage("locale") == "de_CH.UTF-8"]
   page.40.value = bar
[GLOBAL]
```

## Example for EXT:form {#sitehandling-in-conditions-example-ext-form}

Translate options via `siteLanguage` condition:

**EXT:my_site_package/Resources/Private/Forms/MyForm.form.yaml**

```yaml
renderables:
  - type: Page
    identifier: page-1
    label: DE
    renderingOptions:
    previousButtonLabel: 'zurück'
    nextButtonLabel: 'weiter'
    variants:
      - identifier: language-variant-1
        condition: 'siteLanguage("locale") == en_US.UTF-8'
        label: EN
        renderingOptions:
        previousButtonLabel: 'Previous step'
        nextButtonLabel: 'Next step'

```
