Add TypoScript in your extension


This part is written for extension developers.

Create TypoScript files in your extension

TypoScript files should have the ending .typoscript.

They are located in Configuration/TypoScript within your extension.

Usually, you will have the following structure:

└── TypoScript
    ├── constants.typoscript
    └── setup.typoscript
  • constants.typoscript contains the constants

  • setup.typoscript contains the TypoScript setup

Make TypoScript available for static includes

defined('TYPO3') or die();

   $extensionKey = 'myextension';

    * Default TypoScript
      'Some descriptive title'

If you include the TypoScript this way, it will not be automatically loaded. You MUST load it by adding the static include in the Web > Template module in the backend, see Include TypoScript from extensions. This has the advantage of better configurability.

This will load your constants and your setup once the template is included statically.


You may also want to make several different templates available.

Make TypoScript available (always load)

Only do this, if your TypoScript must really be always loaded in your site. If this is not the case, use the method described in the previous section Make TypoScript available for static includes.

defined('TYPO3') or die();

   $extensionKey = 'myextension';

      "@import 'EXT:myextension/Configuration/TypoScript/setup.typoscript'"

More information