Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions Build/Screenshots/create-records.php
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,8 @@
'usergroup' => (string)$dataHandler->substNEWwithIDs['NEWeditors'],
// The example of importing user TSconfig from a site package
'TSconfig' => "@import 'EXT:my_sitepackage/Configuration/TsConfig/User/my_editor.tsconfig'\n",
// The static user TSconfig file of my_extension
'tsconfig_includes' => 'EXT:my_extension/Configuration/TsConfig/User/editor.tsconfig',
]]]);
$testUser = $dataHandler->substNEWwithIDs['NEWtest'];
$uids['testUser'] = $testUser;
Expand Down
1 change: 1 addition & 0 deletions Build/Screenshots/screenshots.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -460,6 +460,7 @@ const screenshots = {
url: editUrl('be_users', testUser),
tab: 'Options',
element: field('TSconfig'),
to: field('tsconfig_includes'),
},
'Configuration/UserTSconfigOverview': {
// Short, the tree of the administrator is long
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<?php

declare(strict_types=1);

use TYPO3\CMS\Core\Utility\ExtensionManagementUtility;

defined('TYPO3') or die();

// A static user TSconfig file, offered in the field "Include static
// TSconfig" of a backend user
ExtensionManagementUtility::registerUserTSConfigFile(
'my_extension',
'Configuration/TsConfig/User/editor.tsconfig',
'Editor',
);
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
options.pageTree.showPageIdWithTitle = 1
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
55 changes: 53 additions & 2 deletions Documentation/UsingSettingTSconfig/UserTSconfig.rst
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,14 @@ Importing the user TSconfig into a backend user or group
:guilabel:`Options > TSconfig`.

.. figure:: /Images/GeneratedScreenshots/BackendUsers/TSconfigUserInput.png
:alt: The TSconfig field in the Options tab of a backend user
:alt: The field "TSconfig" with the line @import
'EXT:my_sitepackage/Configuration/TsConfig/User/my_editor.tsconfig'.
Below it, the field "Include static TSconfig" with the selected
item "Editor (my_extension)" and the path of its file.
:class: with-shadow

The :guilabel:`TSconfig` field in the :guilabel:`Options` tab of a backend user
The :guilabel:`TSconfig` and :guilabel:`Include static TSconfig`
fields in the :guilabel:`Options` tab of a backend user

#. Enter the following TSconfig to import a configuration file from your
sitepackage:
Expand All @@ -50,6 +54,53 @@ group is loaded. The order in which the groups are added to the user in field
The TSconfig from latter groups overrides the TSconfig from earlier groups if
both define the same property.

.. index:: pair: User TSconfig; Include static
.. _include-static-user-tsconfig:

Include static user TSconfig into a backend user or group
=========================================================

.. versionadded:: 14.2
:changelog: feature-78412-1719144405

User TSconfig files that an extension has
:ref:`registered <register-static-user-tsconfig>` can be selected in the
record of a backend user or group, just like static page TSconfig in the page
properties. The configuration stays in the file and is not stored in the
database.

#. Open the record of the user or group.
#. Go to the tab :guilabel:`Options`, then to
:guilabel:`Include static TSconfig` and select the desired configurations
from the :guilabel:`Available Items`, see the
:ref:`figure above <userthetsconfigfield>`.

.. _register-static-user-tsconfig:

Register static user TSconfig files
-----------------------------------

Register user TSconfig files for backend users in the
:file:`Configuration/TCA/Overrides/be_users.php` of any extension:

.. literalinclude:: _UserTSconfig/_be_users.php
:language: php
:caption: EXT:my_sitepackage/Configuration/TCA/Overrides/be_users.php

Register them for backend user groups in
:file:`Configuration/TCA/Overrides/be_groups.php`:

.. literalinclude:: _UserTSconfig/_be_groups.php
:language: php
:caption: EXT:my_sitepackage/Configuration/TCA/Overrides/be_groups.php

The extension key is appended to the title in the selector, so the title
cannot be a
`label reference <https://docs.typo3.org/permalink/t3coreapi:label-reference>`_.

Do not use a comma in the file path. TYPO3 removes every comma from it,
because a comma separates the selected files in the field.

.. index:: pair: User TSconfig; Default values
.. _usersettingdefaultusertsconfig:

Expand Down
11 changes: 11 additions & 0 deletions Documentation/UsingSettingTSconfig/_UserTSconfig/_be_groups.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<?php

declare(strict_types=1);

use TYPO3\CMS\Core\Utility\ExtensionManagementUtility;
Comment thread
linawolf marked this conversation as resolved.

ExtensionManagementUtility::registerUserGroupTSConfigFile(
'my_sitepackage',
Comment thread
linawolf marked this conversation as resolved.
'Configuration/TsConfig/User/news_editors.tsconfig',
Comment thread
linawolf marked this conversation as resolved.
'News editors',
);
11 changes: 11 additions & 0 deletions Documentation/UsingSettingTSconfig/_UserTSconfig/_be_users.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<?php

Comment thread
linawolf marked this conversation as resolved.
declare(strict_types=1);

use TYPO3\CMS\Core\Utility\ExtensionManagementUtility;

ExtensionManagementUtility::registerUserTSConfigFile(
'my_sitepackage',
Comment thread
linawolf marked this conversation as resolved.
'Configuration/TsConfig/User/editor.tsconfig',
Comment thread
linawolf marked this conversation as resolved.
'Editor',
);
Loading