---
title: "ext_conf_template.txt"
manual: "TYPO3 Explained"
version: "12.4"
permalink: "https://docs.typo3.org/permalink/t3coreapi:extension-options@12.4"
source: "ExtensionArchitecture/FileStructure/ExtConfTemplate.rst"
rendered: "2026-10-21T15:29:37+00:00"
---

> [!WARNING]
> **Attention**
>
> TYPO3 v12 has reached end-of-life as of April 30th 2026 and
> is no longer being maintained. Use the version switcher on the top
> left of this page to select documentation for a supported version of TYPO3.
>
> Need more time before upgrading?
> You can purchase Extended Long Term Support (ELTS) for TYPO3 v12 here:
> [TYPO3 ELTS](https://typo3.com/services/extended-support-elts).

# `ext_conf_template.txt` {#extension-options}

-   **ext_conf_template.txt**

    -   *Scope:* extension
    -   *Path (Composer):* packages/my_extension/ext_conf_template.txt
    -   *Path (Classic):* typo3conf/ext/my_extension/ext_conf_template.txt

    In the [`ext_conf_template.txt`](#file-extension-ext-conf-template-txt) file configuration options
    for an extension can be defined. They will be accessible in the TYPO3 backend
    from **Admin Tools > Settings** module.

## Syntax {#extension-options-syntax}

There's a specific syntax to declare these options properly, which is
similar to the one used for TypoScript constants (see "Declaring
constants for the Constant editor" in
[Constants section in TypoScript Reference](https://docs.typo3.org/m/typo3/reference-typoscript/12.4/en-us/UsingSetting/TheConstantEditor.html#typoscript-syntax-constant-editor).
This syntax applies to the comment line that should be placed just before the constant.
Consider the following example (taken from system extension "backend"):

```typoscript
# cat=Login; type=string; label=Logo: If set, this logo will be used instead of...
loginLogo =
```

First a category (cat) is defined ("Login"). Then a type is given ("string") and finally a label, which
is itself split (on the colon ":") into a title and a description. The Label should actually be a localized string, like this:

```typoscript
# cat=Login; type=string; label=LLL:EXT:my_extension_key/Resources/Private/Language/locallang_be.xlf:loginLogo
loginLogo =
```

The above example will be rendered like this in the Settings module:

![Configuration screen for the backend extension](../../Images/ManualScreenshots/ExtensionArchitecture/ExtensionConfigurationOptions.png)

The configuration tab displays all options from a single category. A
selector is available to switch between categories. Inside an option
screen, options are grouped by subcategory. At the bottom of the
screenshot, the label – split between header and description – is
visible. Then comes the field itself, in this case an input, because
the option's type is "string".

## Available option types {#extension-options-available-option-types}

| Option type | Description |
| --- | --- |
| boolean | checkbox |
| color | colorpicker |
| int | integer value |
| int+ | positive integer value |
| integer | integer value |
| offset | offset |
| options | option select |
| small | small text field |
| string | text field |
| user | user function |
| wrap | wrap field |

Option select can be used as follows:

```typoscript
# cat=basic/enable/050; type=options[label1=value1,label2=value2,value3]; label=MyLabel
myVariable = value1
```

"label1", "label2" and "label3" can be any text string. Any integer or string value can be used on the right side of the equation sign "=".

Where user functions have to be written the following way:

```typoscript
# cat=basic/enable/050; type=user[Vendor\MyExtensionKey\ViewHelpers\MyConfigurationClass->render]; label=MyLabel
myVariable = 1
```

<a id="extension-options-accessing-saved-options"></a>

## Accessing saved options {#extension-options-api}

When saved in the Settings module, the configuration will be kept in the `config/system/settings.php`
file and is available as array `$GLOBALS['TYPO3_CONF_VARS']['EXTENSIONS']['my_extension_key']`.

To retrieve the configuration use the API provided by the
`\TYPO3\CMS\Core\Configuration\ExtensionConfiguration` class via
[constructor injection](https://docs.typo3.org/permalink/t3coreapi:constructor-injection@12.4):

**EXT:my_extension/Classes/MyClass.php**

```php
<?php

declare(strict_types=1);

namespace MyVendor\MyExtension\MyClass;

use TYPO3\CMS\Core\Configuration\ExtensionConfiguration;

final class MyClass
{
    public function __construct(
        private readonly ExtensionConfiguration $extensionConfiguration,
    ) {}

    public function doSomething()
    {
        // ...

        $myConfiguration = $this->extensionConfiguration
            ->get('my_extension_key');

        // ...
    }
}

```

This will return the whole configuration as an array.

To directly fetch specific values like `myVariable` from the example above:

**EXT:my_extension/Classes/MyClass.php**

```php
<?php

declare(strict_types=1);

namespace MyVendor\MyExtension\MyClass;

use TYPO3\CMS\Core\Configuration\ExtensionConfiguration;

final class MyClass
{
    public function __construct(
        private readonly ExtensionConfiguration $extensionConfiguration,
    ) {}

    public function doSomething()
    {
        // ...

        $myVariable = $this->extensionConfiguration
            ->get('my_extension_key', 'myVariable');

        // ...
    }
}

```

## Nested structure {#extension-options-nested-structure}

You can also define nested options using the TypoScript notation:

**EXT:some_extension/ext_conf_template.txt**

```typoscript
directories {
   # cat=basic/enable; type=string; label=Path to the temporary directory
   tmp =
   # cat=basic/enable; type=string; label=Path to the cache directory
   cache =
}
```

This will result in a multidimensional array:

**Example output of method `ExtensionConfiguration->get()`**

```text
$extensionConfiguration['directories']['tmp']
$extensionConfiguration['directories']['cache']
```
