A very similar question has already been asked here. I tried to comment to emphasize, but I am not allowed. I tried asking my question in an answer there, but it was deleted instantly. Understandable, but not helpful.
In TYPO3 12, there are possibilities to get TypoScript in the backend using TYPO3\CMS\Core\TypoScript\TemplateService or TYPO3\CMS\Extbase\Configuration\BackendConfigurationManager.
In TYPO3 13, BackendConfigurationManager is declared as final, so one can't set the page id (see question noted above). The use of TemplateService is deprecated. There seems to be an idea of not using TypoScript in the backend, which is technically perfectly logical, but it needs a replacement in real life. There are probably a lot of use cases. Here's mine:
- Backend Class to extend Link Handler with a possibility to link to a specific record (detail page).
- The record is no extbase-record, though, but fetched from external. So, technically speaking, I need just a link to a specific detail page, adding one or multiple parameters. Only that the uid of this detail page can not be hard-coded.
- The package is technically demanding and reusable. The mentioned detail page for a specific Installation is now defined by editors using TypoScript constants. The setting is used on multiple occasions (FE plugins) - not only for the link handler. There are other settings also.
- I do not see a reasonable possibility for the editor to set the same setting by TSConfig (apart from the fact that this kind of redundancy would be unclean and error-prone). Basically, this constant should be enough for all use cases, so also for the link handler. For TYPO3 12 it works just that way.
- Although I think it's good to have all the settings in one place for ease of use, I'm generally open to another solution if necessary. I need advice and expertise, though. It seems a problem touched by future strategy, maybe.
Cut short: I also need access to TypoScript from the Backend Class, outside of the Extbase Controller. Working for TYPO3 12 using TYPO3\CMS\Core\TypoScript\TemplateService or BackendConfigurationManager as mentioned above. No working version for TYPO3 13.
Thanks for any hint on best practice!