I want my calendar extension to return XML and iCal output while avoiding the need of any additional TypoScript (additional page or typeNum). For this purpose I created a dedicated export controller. The correct XML extension template is being loaded but wrapped in the regular HTML page template.
Here’s what I tried in ExportController->listAction()
. The following line does what I hoped it would as there is no HTML <head>
section in the output:
$GLOBALS['TSFE']->config['config']['disableAllHeaderCode'] = 1;
With the following line instead the page is still being parsed completely although I can see the changes in the f:debug output of $GLOBALS['TSFE']->tmpl->setup
:
$GLOBALS['TSFE']->tmpl->setup['page.']['10.']['file'] = 'path/to/empty/templatefile.xml';
I even went further and tried to override all template settings from my TypoScript ($GLOBALS['TSFE']->tmpl->setup['page.']['10.']['file.']['stdWrap.']['cObject.']['default.']
) – with the same result.
While, when setting $GLOBALS['TSFE']->tmpl->setup = null;
, some of the page content is gone: all the output after the extension’s XML template and above it all the content elements – but that part of the template is still there.
Additionally – and unsuccessfully – I tried this:
$this->objectManager->get(\TYPO3\CMS\Core\Page\PageRenderer::class)->setTemplateFile('path/to/empty/templatefile.xml');
Is there any non-TypoScript way to achieve what I want?