Setting user TSconfig

It is recommended to always define custom user TSconfig in a project-specific sitepackage extension. This way the user TSconfig settings can be kept under version control.

Importing the user TSconfig into a backend user or group

  1. Open the record of the user or group. Go to Options > TSconfig.

    The TSconfig field in the Options tab of a backend user

    The TSconfig field in the Options tab of a backend user

  2. Enter the following TSconfig to import a configuration file from your sitepackage:

    TsConfig added in the backend record of a backend user or group
    @import 'EXT:my_sitepackage/Configuration/TsConfig/User/my_editor.tsconfig'
    Copied!

This will make all settings in the file available to the user. The file itself can be kept under version control together with your sitepackage.

TSconfig defined at user level overrides TSconfig defined at group level.

If a user is a member of several groups, the TSconfig from each group is loaded. The order in which the groups are added to the user in field General > Grooup is used.

The TSconfig from latter groups overrides the TSconfig from earlier groups if both define the same property.

Setting default user TSconfig

New in version 13.0

Starting with TYPO3 v13.0 user TSconfig in a file named Configuration/user.tsconfig in an extension is automatically loaded during build time.

User TSconfig is designed to be individual for users or groups of users. However, good defaults can be defined and overridden by group or user-specific TSconfig.

Default user TSconfig should be stored within an extension, usually a sitepackage extension. The content of the file Configuration/user.tsconfig within an extension is automatically loaded during build time.

It is possible to load other user TSconfig files with the import syntax within this file:

EXT:my_extension/Configuration/user.tsconfig
@import 'EXT:my_sitepackage/Configuration/TsConfig/User/default.tsconfig'
Copied!

The PSR-14 event BeforeLoadedUserTsConfigEvent is available to add global static user TSconfig before anything else is loaded.

User TSconfig, compatible with TYPO3 v12 and v13

In TYPO3 v12 installations the content of Configuration/user.tsconfig is not loaded automatically. You can achieve compatibility with both TYPO3 v12 and v13 by importing the content of this file with the API function ExtensionManagementUtility::addUserTSConfig:

EXT:my_sitepackage/ext_localconf.php
<?php

declare(strict_types=1);

use TYPO3\CMS\Core\Information\Typo3Version;
use TYPO3\CMS\Core\Utility\ExtensionManagementUtility;
use TYPO3\CMS\Core\Utility\GeneralUtility;

defined('TYPO3') or die();

$versionInformation = GeneralUtility::makeInstance(Typo3Version::class);
// Only include user.tsconfig if TYPO3 version is below 13 so that it is not imported twice.
if ($versionInformation->getMajorVersion() < 13) {
    ExtensionManagementUtility::addUserTSConfig(
        '@import "EXT:my_sitepackage/Configuration/user.tsconfig"'
    );
}
Copied!

Deprecated since version 13.0

The method \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addUserTSConfig() has been marked as deprecated in TYPO3 v13 and will be removed with TYPO3 v14.

Verify the final configuration

The full user TSconfig of the currently logged-in backend user can be viewed using the System > Configuration backend module and choosing the action $GLOBALS['BE_USER']->getTSConfig() (User TSconfig). However this module can only be accessed by admins.

Viewing user TSconfig using the Configuration module

Viewing user TSconfig using the Configuration module

The Configuration module is available with installed lowlevel system extension.

Override and modify values

Properties, which are set in the TSconfig field of a group, are valid for all users of that group.

Values set in one group can be overridden and modified in the same or another group. If a user is a member of multiple groups, the TSconfig settings are evaluated in the order in which the groups are included in the user account: When editing the backend user, the selected groups are evaluated from top to bottom.

Example:

  • Add in user TSconfig

    EXT:site_package/Configuration/user.tsconfig
    page.RTE.default.showButtons = bold
    Copied!
  • You get the value "bold".
  • Add later in user TSconfig

    EXT:site_package/Configuration/user.tsconfig
    page.RTE.default.showButtons := addToList(italic)
    Copied!
  • You get the value "bold,italic".

Finally, you can override or modify the settings from groups that your user is a member of in the user TSconfig field of that specific user.

Example:

Let's say the user is a member of a usergroup with this configuration:

EXT:site_package/Configuration/page.tsconfig
TCAdefaults.tt_content {
    hidden = 1
    header = Hello!
}
Copied!

Then we set the following values in the TSconfig field of the specific user.

EXT:site_package/Configuration/user.tsconfig
page.TCAdefaults.tt_content.header = 234
options.clearCache.all = 1
Copied!

This would override the default value of the header ("234") and add the clear cache option. The default value of the hidden field is not changed and simply inherited directly from the group.

Overriding page TSconfig in user TSconfig

All properties from page TSconfig can be overridden in user TSconfig by prepending the property name with page..

When a page TSconfig property is set in user TSconfig that way, regardless of whether it is in the TSconfig field of a group or a user, it overrides the value of the according page TSconfig property.

To illustrate this feature let's say the action Web > Info > Localization Overview has been disabled via Page TSconfig:

EXT:site_package/Configuration/page.tsconfig
mod.web_info.menu.function {
   TYPO3\CMS\Info\Controller\TranslationStatusController = 0
}
Copied!

If we activate this configuration in the TSconfig of a certain backend user, that user would still be able to select this menu item because the value of his user TSconfig overrides the same value set in the page TSconfig, just prefixed with page.:

EXT:site_package/Configuration/user.tsconfig
page.mod.web_info.menu.function {
    TYPO3\CMS\Info\Controller\TranslationStatusController = 1
}
Copied!