How to get TYPO3 extension configuration at TypoScript constants?

Accoridng to TYPO3 standard, It's best practice to configure the ext_conf_template.txt file into your custom TYPO3 extension - to provide global TYPO3 configuration. In such situation, if you want get TYPO3 extension configuration to your template (via TypoScript constants), then perform below steps.

How to get TYPO3 extension configuration at TypoScript constants?

According to TYPO3 standard, It's best practice to configure the ext_conf_template.txt file into your custom TYPO3 extension - to provide global TYPO3 configuration. In such situation, if you want to get TYPO3 extension configuration to your template (via TypoScript constants), then perform below steps.

 

// setup.typoscript
plugin.yourextension.settings {
    imageTypes = 
    imageMaxSize = 
}

// ext_localconf.php

// Extension Settings Constants register for the use in basic constants:
if (version_compare(TYPO3_branch, '9.0', '>=')) {
    $nsHelpdeskExtConf = $GLOBALS['TYPO3_CONF_VARS']['EXTENSIONS']['yourextension'];
} else {
    $nsHelpdeskExtConf = unserialize($GLOBALS['TYPO3_CONF_VARS']['EXT']['extConf']['yourextension']);
}

// Add TypoScript Constants
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addTypoScriptConstants(
    'plugin.tx_nshelpdesk_helpdesk.imageMaxSize = 
    ' . $nsHelpdeskExtConf['imageMaxSize']
    . "\n plugin.tx_nshelpdesk_helpdesk.imageTypes = " 
    . $nsHelpdeskExtConf['imageTypes']
);

 

Now you can use this TypoScript constant to your Fluid-templates or TypoScript-configuration

To read an extension's global configuration in TypoScript constants, register it from ext_localconf.php with addTypoScriptConstants. This tutorial shows the setup.typoscript and ext_localconf.php code.

Updated 8 November 2026 | T3Planet editorial team

  • Put global extension settings in ext_conf_template.txt, as TYPO3 standards recommend.
  • Read them in ext_localconf.php and register them as TypoScript constants with addTypoScriptConstants.
  • Then use the constants in your templates and TypoScript.
  • Working with AI tooling in TYPO3? See the TYPO3 MCP Starter Kit.

In ext_conf_template.txt, as recommended by TYPO3 standards.

Register them as constants with addTypoScriptConstants in ext_localconf.php, then use the constants in your TypoScript as shown in this tutorial.

The tutorial describes the approach for current TYPO3 versions. Check the TYPO3 documentation for your version before you use it.

The tutorial shows the setup.typoscript code that reads the registered constants for the plugin.

It registers values as TypoScript constants from ext_localconf.php, so you can use them in your TypoScript and templates.