Project

General

Profile

Actions

Task #65423

closed

Make condition-matching in TemplateService independent of global TSFE

Added by Stefan Neufeind about 9 years ago. Updated about 4 years ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
TypoScript
Target version:
-
Start date:
2015-02-28
Due date:
% Done:

0%

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

Description

To load the TypoScript for an arbitrary page in FE you can do something like:
$tmpl = GeneralUtility::makeInstance('TYPO3\\CMS\\Core\\TypoScript\\TemplateService');
$tmpl->start($rootLine);

Then $tmpl->setup will contain the TypoScript-setup for that page. But condition-matching (PIDinRootLine, ...) still works against the original page (using $GLOBALS['TSFE']) and not the page/rootline of our new TemplateService-instance.

Temporary workaround:
Overwrite parts of the global TSFE (of course backup them first) before calling $tmpl->start().
$GLOBALS['TSFE']->id = $returnPid;
$GLOBALS['TSFE']->tmpl->rootLine = $rootLine;

Actions #1

Updated by Susanne Moog about 5 years ago

  • Status changed from New to Needs Feedback

It's not as easy / only about the condition matcher - the cache entry generated in template service will also reference the original tsfe ID. At the moment, overwriting that ID and rootline seems to be the only way to ensure consistency.

ConditionMatching itself is done independent from the TemplateService - but could get arguments to allow setting rootline and id from outside.
So this issue is basically two issues, what do you think - and can you tackle them?

Actions #2

Updated by Benni Mack about 4 years ago

  • Status changed from Needs Feedback to Closed

Closing this issue now due to lack of feedback. @Stefan feel free to re-open the ticket if you want to

Actions

Also available in: Atom PDF