TYPO3: How to render tt_content text elements in my own extensions?

I am currently writing a TYPO3 extension that is configured with a tt_content UID list. They point to text-based content elements, and I want to make them my extension.

Due to the special way of converting text that you enter in a text editor when it enters the database, etc., turning it into a visual interface, I can’t just display the contents of the database bodytext field.

I want to make these texts the way they will normally be displayed by TYPO3. How can I do it?

+6
php typo3
source share
2 answers

I had the same problem a couple of months ago. Now I have to say that I am not a typo3 developer, so I do not know if this solution is correct.

But I used something like this:

$output .= $this->pi_RTEcssText( $contentFromDb );

in my extension and it works.

+6
source share

Php

This works for me; it displays any content item with this 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 also works for non-cached plugins. You will get a string like <!--INT_SCRIPT.0f1c1787dc3f62e40f944b93a2ad6a81--> , but TYPO3 will replace it on the next pass of INT transmission with real content.

Liquid

If you are in a liquid template, it is useful to use VHS content.render to view the helper :

 <v:content.render contentUids="{0: textelementid}"/> 

If your liquidcontent element has the grid itself, you can visualize the elements using your own content.get or content.render flux:

 <f:section name="Configuration> ... <flux:grid.column name="teaser"/> ... </f:section> <f:section name="Main> <flux:content.render area="teaser"/> <f:section> 
+9
source share

All Articles