Skip to content

Commit 383cdba

Browse files
stefanro-ba
authored andcommitted
[BUGFIX] Respect templateName for fluid template assets rendering
Rendering assets in fluid templates via the special "HeaderAssets" and "FooterAssets" sections does now properly work with a given "templateName" by rendering the "view" before assets rendering takes place, as this does internally correctly set the template name. Resolves: #105390 Releases: main, 13.4 Change-Id: I7cb102a79c35a3e054d5d7d93027c5c9609aba20 Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/86687 Tested-by: core-ci <typo3@b13.com> Tested-by: Benni Mack <benni@typo3.org> Reviewed-by: Oliver Bartsch <bo@cedev.de> Reviewed-by: Benni Mack <benni@typo3.org> Tested-by: Oliver Bartsch <bo@cedev.de>
1 parent 10e0e7f commit 383cdba

File tree

3 files changed

+8
-3
lines changed

3 files changed

+8
-3
lines changed

typo3/sysext/frontend/Classes/ContentObject/FluidTemplateContentObject.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,9 +135,11 @@ public function render($conf = []): string
135135
$variables = $this->contentDataProcessor->process($this->cObj, $conf, $variables);
136136
$view->assignMultiple($variables);
137137

138+
// Rendering the view internally set's the template (paths). This is required for following asset rendering
139+
$content = $view->render($templateFilename);
140+
138141
$this->renderFluidTemplateAssetsIntoPageRenderer($view, $variables);
139142

140-
$content = $view->render($templateFilename);
141143
if (isset($conf['stdWrap.'])) {
142144
return $this->cObj->stdWrap($content, $conf['stdWrap.']);
143145
}
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
page = PAGE
22
page.10 = FLUIDTEMPLATE
33
page.10 {
4-
template = TEXT
5-
template.value = <f:section name="HeaderAssets">Foo Header</f:section><f:section name="FooterAssets">Foo Footer</f:section>
4+
templateName = AssetsSections
5+
templateRootPaths {
6+
10 = EXT:test_fluid_template/Resources/Private/Templates
7+
}
68
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
<f:section name="HeaderAssets">Foo Header</f:section><f:section name="FooterAssets">Foo Footer</f:section>

0 commit comments

Comments
 (0)