[TYPO3-dev] FLUIDTEMPLATE: How to feed in template from content object?

Martin Bless m.bless at gmx.de
Sun Aug 12 21:32:36 CEST 2012


Hello Xavier,

>"file" like virtually all properties supports stdWrap so you should
>easily write something like that:
>
>page.10.file.cObject =< plugin.tx_automatetemplate_pi1

Yes, that looks promising - only it doesn't work.

I can use the stdWrap abilities but still need to provide a legal path
for a real file. FLUIDTEMPLATE is very strict at that point. What I
really want to do is this:

  page {
    10 = FLUIDTEMPLATE
    10 {
      file.cObject = TEMPLATE
      file.cObject {
        template =< plugin.tx_automaketemplate_pi1
        workOnSubpart = DOCUMENT_BODY
      }
    // ...
  }


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.


>HTH

Hope that helps? No, not really.
Happy to help? Thank you, that's great :-)

Martin

-- 
Certified TYPO3 Integrator | TYPO3 Documentation Team Member

http://mbless.de



More information about the TYPO3-dev mailing list