Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[FEATURE] Allow overriding fileFolder config with TSconfig
The "fileFolder" configuration options, available for TCA columns of type "select" are used to fill the select field with predefined files (images / icons). Nowadays this is frequently used to make a corporate icon set available for editors. In multi site installations however, those icon sets usually differ from site to site. Therefore, the AbstractItemProvider is now extended to allow overriding those settings with TSconfig (TCEFORM). Furthermore, to streamline the TCA configuration and to be in line with the corresponding overrides, the "fileFolder" TCA configuration options are moved into a dedicated sub array "fileFolderConfiguration" and the properties are renamed to be consistent with other TCA options. * fileFolder => folder * fileFolder_extList => allowedExtensions * fileFolder_recursions => depth A TCA migration is in place. Resolves: #94406 Releases: master Change-Id: I621198523edfd328ad68d692d9194017c445406f Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/69832 Tested-by: core-ci <typo3@b13.com> Tested-by: Jochen <rothjochen@gmail.com> Tested-by: Benni Mack <benni@typo3.org> Reviewed-by: Jochen <rothjochen@gmail.com> Reviewed-by: Benni Mack <benni@typo3.org>
- Loading branch information
Showing
6 changed files
with
424 additions
and
33 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
100 changes: 100 additions & 0 deletions
100
...angelog/master/Feature-94406-OverrideFileFolderTCAConfigurationWithTSconfig.rst
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,100 @@ | ||
.. include:: ../../Includes.txt | ||
|
||
===================================================================== | ||
Feature: #94406 - Override fileFolder TCA configuration with TSconfig | ||
===================================================================== | ||
|
||
See :issue:`94406` | ||
|
||
Description | ||
=========== | ||
|
||
The special `fileFolder configuration options <https://docs.typo3.org/m/typo3/reference-tca/master/en-us/ColumnsConfig/Type/Select/Properties/FileFolder.html#filefolder>`__ | ||
for TCA columns of type `select` can be used to fill a select field with files | ||
(images / icons) from a defined folder. This is really handy, e.g. for selecting | ||
predefined icons from a corporate icon set. However, in installations with | ||
multiple sites, such icon sets usually differ from site to site. | ||
|
||
Therefore, the `fileFolder` configuration can now be overridden with page | ||
TSconfig, allowing administrators to easily handle those situations by e.g. | ||
using different folders or allowing different file extensions, per site. | ||
|
||
To streamline both, the TCA configuration and the corresponding overrides, | ||
the `fileFolder` configuration options have been moved into a dedicated sub | ||
array :php:`fileFolderConfig`, while the `fileFolder` option has been renamed | ||
to just `folder`, `fileFolder_extList` to `allowedExtensions` and | ||
`fileFolder_recursions` to `depth`. A TCA migration wizard is available, | ||
showing where adjustments have to take place. | ||
|
||
.. code-block:: php | ||
// Before | ||
'aField' => [ | ||
'config' => [ | ||
'type' => 'select', | ||
'renderType' => 'selectSingle', | ||
'fileFolder' => 'EXT:my_ext/Resources/Public/Icons', | ||
'fileFolder_extList' => 'svg', | ||
'fileFolder_recursions' => 1, | ||
] | ||
] | ||
// After | ||
'aField' => [ | ||
'config' => [ | ||
'type' => 'select', | ||
'renderType' => 'selectSingle', | ||
'fileFolderConfig' => [ | ||
'folder' => 'EXT:styleguide/Resources/Public/Icons', | ||
'allowedExtensions' => 'svg', | ||
'depth' => 1, | ||
] | ||
] | ||
] | ||
Thus, the following TSconfig options can be used to overriding their | ||
TCA counterpart: | ||
|
||
.. code-block:: typoscript | ||
config.fileFolderConfig.folder | ||
config.fileFolderConfig.allowedExtensions | ||
config.fileFolderConfig.depth | ||
As already known from TCEFORM, those options can be used on various levels | ||
|
||
On table level: | ||
|
||
.. code-block:: typoscript | ||
TCEFORM.myTable.myField.config.fileFolderConfig.folder | ||
On table and record type level: | ||
|
||
.. code-block:: typoscript | ||
TCEFORM.myTable.myFiled.types.myType.config.fileFolderConfig.folder | ||
On flex form field level: | ||
|
||
.. code-block:: typoscript | ||
TCEFORM.myTable.pi_flexform.my_ext_pi1.sDEF.myField.config.fileFolderConfig.folder | ||
.. note:: | ||
|
||
Except `config.fileFolderConfig.folder`, the new options can not | ||
only be used to override an existing property, but also to define | ||
one, which has not yet been configured in TCA. | ||
|
||
Impact | ||
====== | ||
|
||
It's now possible to override the TCA `fileFolder` configuration options | ||
with page TSconfig, allowing administrators to manipulate the available | ||
items on a page basis. | ||
|
||
The `fileFolder` TCA confgiruation is furthermore streamlined and now | ||
encapsulated in a dedicated sub array :php:`fileFolderConfig`. | ||
|
||
.. index:: Backend, TCA, TSConfig, ext:backend |
Oops, something went wrong.