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

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);
 
       
 
Christian Weiske Christian Weiske
owner

History