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 BE 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'
    

This will make all settings from the file available for 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

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

In extensions this is easily done by the extension API function, \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addUserTSConfig(). In the ext_localconf.php file of your extension you can call it like this to set a default configuration.

my_sitepackage/ext_localconf.php
     /**
      * Adding the default User TSconfig
      */
     \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addUserTSConfig('
   @import "EXT:my_sitepackage/Configuration/TSconfig/User/default.tsconfig"
     ');

There is a global TYPO3_CONF_VARS value called $GLOBALS['TYPO3_CONF_VARS']['BE']['defaultUserTSconfig'] <t3coreapi:typo3ConfVars_be_defaultUserTSconfig>. The API function above adds content to that array. The array value itself however should not be changed or set directly without using the API.

Verify the final configuration

The full User TSconfig of the currently logged-in backend user can be viewed using the System > Configuration 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

Override and modify values

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

Values which are 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 you are editing the backend user, the selected groups are evaluated from top to bottom.

Example:

  • Add in User TSconfig
page.RTE.default.showButtons = bold
  • You get the value “bold”.
  • Add later in User TSconfig
page.RTE.default.showButtons := addToList(italic)
  • You get the value “bold,italic”.

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

Example:

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

TCAdefaults.tt_content {
        hidden = 1
        header = Hello!
}

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

TCAdefaults.tt_content.header = 234
options.clearCache.all = 1

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:

mod.web_info.menu.function {
   TYPO3\CMS\Info\Controller\TranslationStatusController = 0
}

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.:

page.mod.web_info.menu.function {
   TYPO3\CMS\Info\Controller\TranslationStatusController = 1
}

Important

It is not possible to reference the value of a property from Page TSconfig and to modify this value in User TSconfig! If you set a property in User TSconfig, which already had been set in Page TSconfig, then the value from Page TSconfig will be overridden.

The result of the example below is not the value “bold,italic”, but the value “italic”.

# Enable the "bold" button in Page TSconfig (!)
RTE.default.showButtons = bold
# Try to additionally add the "italic" button in User TSconfig (!)
page.RTE.default.showButtons := addToList(italic)