Issue Feature Rejected

#93741Feature request: function getTypoScriptForPage

Thomas Anders 03/15/21, 12:13 updated 02/03/25, 05:57

Description

I built a Symfony command that is configurable wit TypoScript but I could bring it to work only with help (Thanks to Jonas Eberle).
I struggled at the point where I needed the generated TypoScript for a specified rootpage.

I ended up with something like this:

$pid = 1234

$templateService = GeneralUtility::makeInstance(TemplateService::class);
$rootlineUtility = GeneralUtility::makeInstance(RootlineUtility::class, $pid);
$rootline = $rootlineUtility->get();
$templateService->runThroughTemplates($rootline);
$templateService->generateConfig();

dump($templateService->setup);

This seemed not very straightforward to me and after this I’m wishing me something like:

$typoscript = GeneralUtility::makeInstance(TypoScriptService::class)->getTypoScriptForPage($uid);

Reviews 0

No change resolves or names this issue in its commit message, and no comment links one.

History 2

  1. Christian Kuhn commented <span data-processor="relativetime" data-value="2022-06-28T16:06:15+00:00" > 06/28/22, 16:06 </span>

    That’s not trivially easy since especially $rootline may not be what it looks like at first glance: When mountpoints are involved, the rootline needs quite some magic in TSFE to be calculated correctly.

  2. Christian Kuhn commented and changed status New Rejected <span data-processor="relativetime" data-value="2025-02-03T05:57:29+00:00" > 02/03/25, 05:57 </span>

    Hey.

    I hope its ok to close here: TS calculation improved a lot with v13 but still has a few dependencies: It won’t be as trivial as a getTypoScriptForPage(), but it is now encapsulated in FrontendTypoScriptFactory, which is currently the most simple approach we could come up with.