Feature #39767
closedFLUIDTEMPLATE should accept template from content objects as TEMPLATE does
100%
Description
It seems that FLUIDTEMPLATE misses a feature that would really be useful. It is something you would expect to have and it's good for TYPO3.
Currently you HAVE TO provide a physical file as template for FLUIDTEMPLATE. This is in contrast to the normal TEMPLATE object which takes the template from other content objects as well.
Please see this thread as well:
http://lists.typo3.org/pipermail/typo3-dev/2012-August/045745.html
I would like to write for example:
### does not work currently!!! page { 10 = FLUIDTEMPLATE 10 { file.cObject = TEMPLATE file.cObject { template =< plugin.tx_automaketemplate_pi1 workOnSubpart = DOCUMENT_BODY } // ... }
Quoting Xavier's answer to my question:
Hi Martin,
But this doesn't work because in class.tslib_content_fluidtemplate.php around line 69 there is:
/**
* 1. initializing Fluid StandaloneView and setting configuration parameters
**/
$view = t3lib_div::makeInstance('Tx_Fluid_View_StandaloneView');
// fetch the Fluid template
$file = isset($conf['file.'])
? $this->cObj->stdWrap($conf['file'], $conf['file.'])
: $conf['file'];
$templatePathAndFilename = $GLOBALS['TSFE']->tmpl->getFileName($file);
$view->setTemplatePathAndFilename($templatePathAndFilename);
$templatePathAndFilename will be set to FALSE when I provide something else than a legal path to an existing file. And then there is no template which gives an error.
You're right. Seems indeed like a missing feature that would really be useful for FLUIDTEMPLATE (a bit less for standard Fluid I guess). I would contact the Fluid team ASAP and see with them for a tangible solution to be integrated into 6.0 (no way to get it into 4.7 or 4.6 as it'll be a new feature). But it has to probably be kept in sync with the version in FLOW3 and the feature freeze of 6.0 is coming soon.
It would be really great if we could do something about this missing feature. Otherwise many usecases of TEMPLATE can't be rewritten using FLUIDTEMPLATE. I'm missing that feature very much as I usually use directly the HTML "clickdummy" a web designer has provided as template source. This avoids lots of work and discussion: I can always click the "clickdummy" and verify that the HTML of the template works.
Updated by Markus Klein over 12 years ago
Hi!
IMO this is not a Feature for Fluid, but for Core.
Keep in mind that if you make the template directly assignable, you have to set the path for partials and layouts separately in the configuration.
Updated by Martin Bless over 12 years ago
- Project changed from 534 to TYPO3 Core
Updated by Christian Müller over 12 years ago
Yes I think this is specific to the FLUIDTEMPLATE Typoscript object, so it has nothing to do with Fluid/FLOW3, because in the end Fluid should get a template file assigned (maybe that will make it necessary to write a temporary file or - but then it will be a Fluid/FLOW3 issue too - have a method to assign the template as a string to Fluid (which I tend to dislike, but on the other hand could be handy sometimes also for other purposes).
Updated by Martin Bless over 12 years ago
Christian Mueller wrote:
... because in the end Fluid should get a template file assigned (maybe that will make it necessary to write a temporary file
I'm not a PHP guru - so I ask myself and I'm asking the experts: Is it possible to create a file like object in memory? If yes this could provide a clean and easy solution and leave most of the Fluid and class.ts_content.php code untouched.
Updated by Gerrit Code Review about 12 years ago
- Status changed from New to Under Review
Patch set 1 for branch master has been pushed to the review server.
It is available at http://review.typo3.org/16241
Updated by Helmut Hummel about 12 years ago
- Target version set to 6.1.0
- TYPO3 Version set to 4.5
Pushed a possible patch. But would postpone this to 6.1
Updated by Gerrit Code Review about 12 years ago
Patch set 2 for branch master has been pushed to the review server.
It is available at http://review.typo3.org/16241
Updated by Gerrit Code Review almost 12 years ago
Patch set 3 for branch master has been pushed to the review server.
It is available at http://review.typo3.org/16241
Updated by Gerrit Code Review almost 12 years ago
Patch set 4 for branch master has been pushed to the review server.
It is available at https://review.typo3.org/16241
Updated by Christian Kuhn almost 12 years ago
Test scenario for pending patch, once with a FILE cObj (you need some template file then), one with TEXT cObj
page > page = PAGE page.10 = FLUIDTEMPLATE page.10 { # template = FILE # template.file = fileadmin/templates/MyTemplate.html template = TEXT template.value = <h1>{data.title}</h1> partialRootPath = fileadmin/templates/partial/ variables { mylabel = TEXT mylabel.value = Label coming from TypoScript! } }
Updated by Helmut Hummel almost 12 years ago
- Status changed from Under Review to Resolved
- % Done changed from 0 to 100
Applied in changeset 17ba001ccaec73a90b499de19d1aeefc74242b44.
Updated by Oliver Hader over 11 years ago
- Target version changed from 6.1.0 to 6.1.0-alpha1
Updated by Riccardo De Contardi about 7 years ago
- Status changed from Resolved to Closed