Project

General

Profile

Actions

Feature #93741

open

Feature request: function getTypoScriptForPage

Added by Thomas Anders about 3 years ago. Updated almost 2 years ago.

Status:
New
Priority:
Should have
Assignee:
-
Category:
TypoScript
Target version:
-
Start date:
2021-03-15
Due date:
% Done:

0%

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

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);

Actions #1

Updated by Christian Kuhn almost 2 years ago

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.

Actions

Also available in: Atom PDF