How to render a Content Object from tt_content in my extension with PHP in Typo3 6.1.5

dusty picture dusty · Nov 29, 2013 · Viewed 12.3k times · Source

I need to render with my extension a specific content from tt_content.

How can I do this?

\TYPO3\CMS\Frontend\ContentObject\ContentObjectRenderer ?

Answer

nbar picture nbar · Nov 29, 2013

In Extbase extensions $this->cObj is no more available in the current scope, so you need to get it first before you can use:

$cObj = $this->configurationManager->getContentObject();

$ttContentConfig = array(
    'tables'       => 'tt_content',
    'source'       => 123,
    'dontCheckPid' => 1
);

$content .= $cObj->RECORDS($ttContentConfig);