Hook into backend

Hi,
I need to hook into the backend to modify a custom domain object with external data via API every time the sysfolder with the custom domain objects is loaded. My Idea was to use the ‘renderPreProcess’ hook of BackendController and update the data when the page id of the specific sysfolder matches the page id in the request object.

$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['typo3/backend.php']['renderPreProcess'][] = \MyVendor\Sitepackage\Hooks\BackendControllerHook::class . '->loadExternalData';

The problem is that the hook is called only once, when typo3 backend is loaded. Navigating through the pages does not trigger the hook anymore.

Is there another hook for this purpose?

Hi Thomas, could you go more into details about your use case and the nature of the data?
Is this because you want to show some external data in the List Module (I am deducting that from “sysfolder”)?
Why only in the backend? Is this some informational data for your backend editors?

It might be that you would be better off importing the data regularly but that depends.
Instead of hooking into the backend rendering, you might consider a JavaScript solution? Generally using external APIs in the main rendering path has some bad implications like at least slowing the rendering down.

Also, if you want help on how to alter backend views and use hooks, we would need to know your TYPO3 version.

Hi Jonas,
the domain object is for event tags and the data comes from Hubspot.
The event tags are used in the frontend as well.
The user can edit the Hubspot event-tags in typo3 (create, update, delete) as well. When saved, they are then updated via API at Hubspot (this happens via TCEmainHook). The data needs to be up to date, every time the user loads the list view with the event tags in typo3 backend. For this the hook is needed.
Doing the API call in the main rendering path works fine. The time delay resulting from this is acceptable at approx. 1 second.