Bug #73207
closedChanging the Template of a fluid widget does not work
Added by Stefan Froemken almost 9 years ago. Updated almost 3 years ago.
100%
Description
Hello,
I want to change the template of a fluid widget with following TypoScript:
module.tx_devlog.view.widget.TYPO3\CMS\Fluid\ViewHelpers\Widget\PaginateViewHelper.templateRootPaths { 10 = EXT:devlog/Resources/Private/Templates/ViewHelpers/Widget/Paginate/Index.html }
I have also tried that one:
module.tx_devlog.view.widget.TYPO3\CMS\Fluid\ViewHelpers\Widget\PaginateViewHelper.templateRootPath = EXT:devlog/Resources/Private/Templates/ViewHelpers/Widget/Paginate/Index.html
While processing these values in Fluid, my template will be added AFTER the Fluid one. But in extractPathArrays you resort the values with krsort. Now my template is the first one and will be overwritten by Fluidtemplates again.
With my last idea I overwrite the full template path of Fluid:
module.tx_fluid.view.templateRootPaths { 10 = EXT:devlog/Resources/Private/Templates/ }
Now my template path will be added BEFORE the Fluid one. In extractPathArray the templates will be resorted again and my template path is the last one. Yeah. That's correct.
Stefan
Updated by Claus Due almost 9 years ago
Could you try "10 = EXT:devlog/Resources/Private/Templates/ViewHelpers/Widget/" instead, please? The values should be root paths (excluding the Widget's controller name) so the "Paginate/Index.html" part should be added when resolving the template. It's basically the same as putting nested view configuration in "widget.$className".
Updated by Wouter Wolters almost 9 years ago
- Status changed from New to Needs Feedback
Updated by Stefan Froemken almost 9 years ago
Sorry. It doesn't work.
In setViewConfiguration() we have a call to $view->getTemplatePaths()->fillFromConfigurationArray() which sets my configuration. Everything is alright until now.
Just 2 or 3 Rows later canRender() will be called, which executes $this->setControllerContext(). The problem is here: $this->baseRenderingContext->getTemplatePaths()->fillDefaultsByPackageName($request->getControllerExtensionKey()); which overwrites my previously (correct) defined settings with defaults again.
Stefan
Updated by Frank Nägler over 8 years ago
For news the overwrite looks like this:
plugin.tx_news.view.widget.GeorgRinger\News\ViewHelpers\Widget\PaginateViewHelper.templateRootPath = EXT:news/Resources/Private/Templates/
can you try this with adapted paths?
Updated by Stefan Froemken over 8 years ago
I have tried these versions now:
module.tx_devlog.view.widget.TYPO3\CMS\Fluid\ViewHelpers\Widget\PaginateViewHelper.templateRootPaths {
10 = EXT:devlog/Resources/Private/Templates/
}
and
module.tx_devlog.view.widget.TYPO3\CMS\Fluid\ViewHelpers\Widget\PaginateViewHelper.templateRootPath = EXT:devlog/Resources/Private/Templates/
Both does not work.
Updated by Alex Kellner over 8 years ago
Can confirm this. It's not possible to set an own HTML-Template in my backend module for TYPO3 8.0
module.tx_powermail { view { widget.TYPO3\CMS\Fluid\ViewHelpers\Widget\PaginateViewHelper.templateRootPath = EXT:powermail/Resources/Private/Templates/ widget.TYPO3\CMS\Fluid\ViewHelpers\Widget\PaginateViewHelper.templateRootPaths { 10 = EXT:powermail/Resources/Private/Templates/ } } }
templateRootPath seems to work in 7.6
Updated by Dominik Hahn about 8 years ago
Hey guys,
the same happened to me today, after updating TYPO3 CMS to the latest dev-master.
We have two extensions:
The first one defines the paths to it's templates by using templateRootPaths.1
the second extension extends those paths (and overwrites certain templates) by using templateRoothPaths.10
I was wondering why the templates of the second extension (albeit the higher index) were not showing up in the templates after performing the update.
Debugging the method 'getContextSpecificViewConfiguration()' of the 'TemplatePaths' class with a var_dump() I have learnt that this function seems to be executed twice for every plugin on the page.
On the first call:
/srv/www/public/sites/debugging/vendor/typo3/cms/typo3/sysext/fluid/Classes/View/TemplatePaths.php:116: array (size=3) 0 => string '/srv/www/public/sites/debugging/Web/typo3conf/ext/custom_extension/Resources/Private/Templates/' (length=106 1 => string '/srv/www/public/sites/debugging/Web/typo3conf/ext/custom_extension/Resources/Private/Templates/Plugins/' (length=114) 10 => string '/srv/www/public/sites/debugging/Web/typo3conf/ext/custom_extension_two/Resources/Private/Templates/Extensions/Demo/Plugins/' (length=146)
On the second call:
/srv/www/public/sites/debugging/vendor/typo3/cms/typo3/sysext/fluid/Classes/View/TemplatePaths.php:116: array (size=3) 0 => string '/srv/www/public/sites/debugging/Web/typo3conf/ext/custom_extension_two/Resources/Private/Templates/Extensions/Demo/Plugins/' (length=146) 1 => string '/srv/www/public/sites/debugging/Web/typo3conf/ext/custom_extension/Resources/Private/Templates/Plugins/' (length=114) 2 => string '/srv/www/public/sites/debugging/Web/typo3conf/ext/custom_extension/Resources/Private/Templates/' (length=106)
I guess the second call wins, the index of my custom templates is set to "0" and the default templates are loaded.
It all drills down to the setControllerContext method of the AbstractTemplateView as already pointed out in https://forge.typo3.org/issues/73207#note-3
I really hope this helps resolving this annoying problem.
As a temporary fix, I am completely overwriting templateRootPaths.1 in my second extension.
Updated by Frank Nägler about 8 years ago
- Status changed from Needs Feedback to Accepted
Updated by Mark Watney almost 8 years ago
I can also can confirm this with TYPO3 CMS 8.5.0.
Updated by Gerrit Code Review almost 8 years ago
- Status changed from Accepted to Under Review
Patch set 1 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/51057
Updated by Benni Mack almost 8 years ago
- Target version changed from 8.5 to 8.6
Updated by Benni Mack almost 8 years ago
- Target version changed from 8.6 to 8 LTS
Updated by Benni Mack over 7 years ago
- Target version changed from 8 LTS to next-patchlevel
Updated by Denis Mir about 7 years ago
I can confirm this issue on TYPO3 8.7.6. It is still not possible to override the template of the paginate widget. (I have tried out several ways of configuring it) Neither `templateRootPath` nor `templateRootPaths` does work.
Updated by Gerrit Code Review about 7 years ago
Patch set 5 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/54140
Updated by Gerrit Code Review about 7 years ago
Patch set 6 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/54140
Updated by Gerrit Code Review about 7 years ago
Patch set 7 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/54140
Updated by Gerrit Code Review about 7 years ago
Patch set 8 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/54140
Updated by Gerrit Code Review about 7 years ago
Patch set 9 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/54140
Updated by Gerrit Code Review about 7 years ago
Patch set 7 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/53958
Updated by Gerrit Code Review about 7 years ago
Patch set 10 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/54140
Updated by Gerrit Code Review about 7 years ago
Patch set 8 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/53958
Updated by Gerrit Code Review about 7 years ago
Patch set 11 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/54140
Updated by Gerrit Code Review about 7 years ago
Patch set 9 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/53958
Updated by Gerrit Code Review about 7 years ago
Patch set 10 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/53958
Updated by Gerrit Code Review about 7 years ago
Patch set 12 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/54140
Updated by Gerrit Code Review about 7 years ago
Patch set 13 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/54140
Updated by Gerrit Code Review about 7 years ago
Patch set 11 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/53958
Updated by Gerrit Code Review about 7 years ago
Patch set 1 for branch TYPO3_8-7 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/54156
Updated by Helmut Hummel about 7 years ago
- Status changed from Under Review to Resolved
- % Done changed from 0 to 100
Applied in changeset 5b1dff4c9b848f5474d91460ffd86c2283c62967.
Updated by Gerrit Code Review about 7 years ago
- Status changed from Resolved to Under Review
Patch set 14 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/54140
Updated by Gerrit Code Review about 7 years ago
Patch set 15 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/54140
Updated by Gerrit Code Review about 7 years ago
Patch set 16 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/54140
Updated by Gerrit Code Review about 7 years ago
Patch set 17 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/54140
Updated by Gerrit Code Review about 7 years ago
Patch set 18 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/54140
Updated by Gerrit Code Review about 7 years ago
Patch set 19 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/54140
Updated by Gerrit Code Review about 7 years ago
Patch set 20 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/54140
Updated by Gerrit Code Review about 7 years ago
Patch set 21 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/54140
Updated by Gerrit Code Review about 7 years ago
Patch set 22 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/54140
Updated by Gerrit Code Review about 7 years ago
Patch set 23 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/54140
Updated by Gerrit Code Review about 7 years ago
Patch set 24 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/54140
Updated by Gerrit Code Review about 7 years ago
Patch set 25 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/54140
Updated by Gerrit Code Review about 7 years ago
Patch set 26 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/54140
Updated by Gerrit Code Review almost 7 years ago
Patch set 27 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/54140
Updated by Gerrit Code Review almost 7 years ago
Patch set 28 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/54140
Updated by Gerrit Code Review almost 7 years ago
Patch set 29 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/54140
Updated by Gerrit Code Review almost 7 years ago
Patch set 30 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/54140
Updated by Gerrit Code Review almost 7 years ago
Patch set 31 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/54140
Updated by Gerrit Code Review almost 7 years ago
Patch set 32 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/54140
Updated by Gerrit Code Review almost 7 years ago
Patch set 33 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/54140
Updated by Gerrit Code Review almost 7 years ago
Patch set 34 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/54140
Updated by Gerrit Code Review almost 7 years ago
Patch set 35 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/54140
Updated by Gerrit Code Review almost 7 years ago
Patch set 36 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/54140
Updated by Gerrit Code Review almost 7 years ago
Patch set 37 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/54140
Updated by Gerrit Code Review almost 7 years ago
Patch set 38 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/54140
Updated by Gerrit Code Review almost 7 years ago
Patch set 39 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/54140
Updated by Gerrit Code Review almost 7 years ago
Patch set 40 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/54140
Updated by Gerrit Code Review almost 7 years ago
Patch set 41 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/54140
Updated by Gerrit Code Review almost 7 years ago
Patch set 42 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/54140
Updated by Gerrit Code Review almost 7 years ago
Patch set 43 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/54140
Updated by Gerrit Code Review almost 7 years ago
Patch set 44 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/54140
Updated by Riccardo De Contardi over 6 years ago
- Related to Bug #84575: Fluid autocomplete widget not working anymore added
Updated by Susanne Moog over 5 years ago
- Status changed from Under Review to New
Path has been abandoned.
Updated by Benni Mack over 5 years ago
- Target version changed from next-patchlevel to Candidate for patchlevel
Updated by Claus Due over 4 years ago
- Status changed from New to Resolved