I'm currently writing a TYPO3 extension which is configured with a list of tt_content
UID's.
These point to content elements of type "text" and i want to render them by my extension.
Because of TYPO3s special way of transforming the text you enter in the rich text editing when it enters the database, and again transforming it when it is rendered to the frontend, i can not just output the database contents of the bodytext
field.
I want to render these texts as they would usually get rendered by TYPO3. How do I do that?
That works for me; it renders any content element with the given ID:
function getCE($id)
{
$conf['tables'] = 'tt_content';
$conf['source'] = $id;
$conf['dontCheckPid'] = 1;
return $GLOBALS['TSFE']->cObj->cObjGetSingle('RECORDS', $conf);
}
See http://lists.typo3.org/pipermail/typo3-dev/2007-May/023467.html
This does work for non-cached plugins, too. You will get a string like <!--INT_SCRIPT.0f1c1787dc3f62e40f944b93a2ad6a81-->
, but TYPO3 will replace that on the next INT rendering pass with the real content.
If you're in a fluid template, the VHS content.render
view helper is useful:
<v:content.render contentUids="{0: textelementid}"/>
If your fluidcontent element has a grid itself, you can render the elements with flux' own content.get
or content.render
view helper:
<f:section name="Configuration>
... <flux:grid.column name="teaser"/> ...
</f:section>
<f:section name="Main>
<flux:content.render area="teaser"/>
<f:section>
I had the same problem a couple of months ago. Now I must say that I am no typo3 developer, so I don't know if this is the right solution.
But I used something like this:
$output .= $this->pi_RTEcssText( $contentFromDb );
in my extension and it works.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With