TYPO3 v11: Manually render content element by its UID within PHP

revision 0ff72222771d79779b9e6e01bbf8f59f40e4485a

raw

phork0.php

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
<?php
use TYPO3\CMS\Core\Utility\GeneralUtility;
use TYPO3\CMS\Frontend\ContentObject\RecordsContentObject;
 
$conf = [
    'tables'       => 'tt_content',
    'source'       => $elementId,
    'dontCheckPid' => 1,
];
$html = GeneralUtility::makeInstance(
    RecordsContentObject::class, $GLOBALS['TSFE']->cObj
)->render($conf);
 
       
 

History