Bug #98200
closed
Fluid does not apply stdWrap to templateRootPaths
Added by Stefan Froemken about 2 years ago.
Updated 5 months ago.
Description
Hello Fluid Team,
in documentation I found a pretty cool information for templateRootPaths:
https://docs.typo3.org/m/typo3/reference-typoscript/10.4/en-us/ContentObjects/Fluidtemplate/Index.html#templaterootpaths
Quote "Data type: array of file paths with stdWrap"
I just used it that way:
templateRootPaths {
0 = EXT:events2/Resources/Private/Templates/
1 = EXT:events2/Resources/Private/Templates/Overrides/
1.if.isTrue = {$plugin.tx_events2.settings.useExtForm}
2 = {$plugin.tx_events2.view.templateRootPath}
}
But frontend results in:
(1/1) #1476107295 TYPO3\CMS\Core\Error\Exception
PHP Warning: rtrim() expects parameter 1 to be string, array given in /var/www/html/vendor/typo3fluid/fluid/src/View/TemplatePaths.php line 468
Nice greetings
Stefan
Side-note: Just in case that just docs are wrong, please keep it like that. Using stdWrap
on declarative settings like paths, which are processed by other components (e.g. Fluid), is not a good idea...
Something like this seems to be more explicit (avoiding to use stdWrap
, but utilizing TypoScript constants):
[{$plugin.tx_events2.settings.useExtForm}]
plugin.whatever.view {
templateRootPaths.1 = EXT:events2/Resources/Private/Templates/Overrides/
}
[end]
But actually that might be defined on a site-level, e.g. like https://docs.typo3.org/m/typo3/reference-typoscript/main/en-us/Conditions/Index.html#id56
- Status changed from New to Needs Feedback
Hi Olli,
I just have solved it that way.
For me it's not a problem, if these 3 sections (for layout*, partials* and templateRootPaths) will be removed from documentation.
Stefan
I guess that removing them from documentation is not a good solution. At least, the statement "stdWrap" shouldb removed and emphasized that stdWrap should not be used for these (as noteice or something like that).
So, this works:
templateRootPaths {
1.cObject = TEXT
1.cObject.value = EXT:events2/Resources/Private/Templates/Overrides/
1.cObject.if.isTrue = {$plugin.tx_events2.settings.useExtForm}
}
- Status changed from Needs Feedback to Resolved
The best practice to use conditions here has been added to the documentation.
- Status changed from Resolved to Closed
Also available in: Atom
PDF