[TYPO3] Displaying a (Flexible) Content Element from PHP
Helge Preuss
scout at hyperspace-travel.de
Sun May 6 18:33:36 CEST 2007
media.res | alex widschwendter wrote:
>> in an extension I am writing I need to display a Content Element,
>> preferably a Flexible Content Element, from PHP. I haven't found a
>> function to do this in the API documentation or on Google, but I am sure
>> there must exist one.
>>
>> Can you help me out, please?
>>
>
> http://typo3.org/documentation/document-library/extension-manuals/templavoila/1.3.0/view/1/6/
>
> and check the mini news code for reference and hints.
>
Digging through the docs and the Templavoila code, I found the following
function:
/**
* Common function for rendering of the Flexible Content / Page
Templates.
* For Page Templates the input row may be manipulated to contain
the proper reference to a data structure (pages can have those inherited
which content elements cannot).
*
* @param array Current data record, either a tt_content
element or page record.
* @param string Table name, either "pages" or "tt_content".
* @return string HTML output.
*/
function renderElement($row,$table) {
// ...
}
I assume this is the one I have to use to render a Flexible CE. But when
I try to use it, I get this error:
Fatal error: Call to a member function editIcons() on a non-object in
/var/www/onlinetaz/typo3_src-4.0.5/typo3/sysext/cms/tslib/class.tslib_pibase.php
on line 910
I have tried to access the function in this way:
$FCE_Renderer = t3lib_div::makeInstance('tx_templavoila_pi1');
return $FCE_Renderer->renderElement($ce, 'tt_content');
What am I doing wrong?
Greets, Helge
More information about the TYPO3-english
mailing list