Project

General

Profile

Actions

Feature #97259

open

Add option to pass additionalFields to PageTreeRepository, when building the tree

Added by Philipp Wrann about 2 years ago. Updated over 1 year ago.

Status:
New
Priority:
Should have
Assignee:
-
Category:
Backend User Interface
Target version:
-
Start date:
2022-03-30
Due date:
% Done:

0%

Estimated time:
PHP Version:
Tags:
Complexity:
medium
Sprint Focus:

Description

Using the Hook $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS'][\TYPO3\CMS\Core\Imaging\IconFactory::class]['overrideIconOverlay'] it is possible to modify the overlay-icon for icons created with the IconFactory class. But it is not possible to add custom overlays based on new fields (pages table) for the page-tree because the row will never contain the fields you added.

The PageTreeRepository can receive additional fields to select in the constructor but the TreeController does pass a hard-coded empty array.

The hook to midify the icon overlay:
https://github.com/TYPO3/typo3/blob/main/typo3/sysext/core/Classes/Imaging/IconFactory.php#L361

Called here:
https://github.com/TYPO3/typo3/blob/main/typo3/sysext/backend/Classes/Controller/Page/TreeController.php#L370

PageTreeRepository instantiation responsible for loading the page record:
https://github.com/TYPO3/typo3/blob/main/typo3/sysext/backend/Classes/Controller/Page/TreeController.php#L486

Query created by repository:
https://github.com/TYPO3/typo3/blob/main/typo3/sysext/backend/Classes/Tree/Repository/PageTreeRepository.php#L520

What i want to achieve:

I simply added a field to the pages table to disable robots (recursive) for the page and all sub-pages. To show the setting to a logged in backend-user i want to display a overlay ontop of that page. Something like a stop-sign. At the moment there is no safe way (besides XClassing or firing a second query to fetch the new field inside the hook) of adding such a feature.

By adding a configuration like $GLOBALS['TYPO3_CONF_VARS']['BE']['pageTreeAdditionalFields'] and merging that field additionally inside the PageTreeRepository, this could be enhanced very easily.

Actions #1

Updated by Susanne Moog over 1 year ago

  • Complexity changed from no-brainer to medium
  • Sprint Focus set to On Location Sprint
Actions #2

Updated by Oliver Hader over 1 year ago

  • Sprint Focus deleted (On Location Sprint)
Actions

Also available in: Atom PDF