#98200Fluid does not apply stdWrap to templateRootPaths
Description
Hello Fluid Team,
in documentation I found a pretty cool information for 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
Reviews 0
No change resolves or names this issue in its commit message, and no comment links one.
History 10
-
Oliver Hader commented 08/25/22, 08:17
-
Oliver Hader changed status
NewNeeds Feedback 08/25/22, 08:23 -
Stefan Froemken commented 08/25/22, 10:03
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
-
Stefan Bürk commented 08/25/22, 22:30
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).
-
Chris Müller commented 08/26/22, 16:13
The stdWrap functionality (“1.”) cannot be used together with a dedicated path (“1”), so in your example the “1.” part is ignored:
I will take care of adjusting the documentation.
-
Chris Müller commented 08/26/22, 16:21
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} } -
Chris Müller commented 08/26/22, 16:51
-
Simon Praetorius commented 06/19/23, 09:12
I added another PR since the last one didn’t make it into the documentation:
https://github.com/TYPO3-Documentation/TYPO3CMS-Reference-Typoscript/pull/758 -
Simon Praetorius commented and changed status
Needs FeedbackResolved 06/19/23, 09:47The best practice to use conditions here has been added to the documentation.
-
Benni Mack changed status
ResolvedClosed 07/09/24, 12:46
Side-note: Just in case that just docs are wrong, please keep it like that. Using
stdWrapon 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