Task #94406
closedTCA select fileFolder should be able to call custom class or hook to scope output
100%
Description
The TCA type select and renderType selectSingle has no option to change the "fileFolder" path with a custom class (userFunc) or hook.
If your T3 instance has more than one project / site project, the icons should be scoped to the project A or B. Project A should not see files of project B.
The available itemsProcFunc is called after the internal `addItemsFromFolder` method. All the magic is done before the itemsProcFunc and there is no way to change the fileFolder configuration before.
Idea:The fileFolder configuration should accept multiple ways of definiton.
- EXT:my_ext/Resources/Public/Icons/
- RELATIVE_TO_PUBLIC_PATH/fileadmin/foo/bar
- VENDOR\ACME\Hooks\TCA\MyCustomFileFolderHook::class->rewriteFolderPath(....)
TCA documentation: https://docs.typo3.org/m/typo3/reference-tca/10.4/en-us/ColumnsConfig/Type/selectSingle.html#filefolder
'field' => [
'config' => [
'type' => 'select',
'renderType' => 'selectSingle',
'maxitems' => 1,
'items' => [
['', 0],
],
'fileFolder' => 'EXT:my_ext/Resources/Public/Icons/',
'fileFolder_extList' => 'svg',
'fileFolder_recursions' => 0,
],
],
Example and idea with a custom class
'field' => [
'config' => [
'type' => 'select',
'renderType' => 'selectSingle',
'maxitems' => 1,
'items' => [
['', 0],
],
'fileFolder' => 'VENDOR\ACME\Hooks\TCA\MyCustomFileFolderHook::rewriteFolderPath',
'fileFolder_extList' => 'svg',
'fileFolder_recursions' => 0,
],
],
Updated by Gerrit Code Review over 3 years ago
- Status changed from New to Under Review
Patch set 1 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/69832
Updated by Gerrit Code Review over 3 years ago
Patch set 2 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/69832
Updated by Gerrit Code Review over 3 years ago
Patch set 3 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/69832
Updated by Gerrit Code Review over 3 years ago
Patch set 4 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/69832
Updated by Gerrit Code Review over 3 years ago
Patch set 5 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/69832
Updated by Gerrit Code Review over 3 years ago
Patch set 6 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/69832
Updated by Oliver Bartsch over 3 years ago
- Status changed from Under Review to Resolved
- % Done changed from 0 to 100
Applied in changeset 2f0c2656684628832e4e4895f92a62d98524aec1.