This is how StandardContentPreviewRenderer
works in v13:
- either provide the path to a template file:
mod.web_layout.tt_content.preview {
my_content_type = EXT:my_extension/Resources/Private/Templates/Preview/MyContentType.html
}
- OR listen to
PageContentPreviewRenderingEvent
with a custom event listener:
<?php
namespace My\CustomExtension\EventListener;
use TYPO3\CMS\Backend\View\Event\PageContentPreviewRenderingEvent;
use TYPO3\CMS\Core\Attribute\AsEventListener;
#[AsEventListener(
identifier: 'my-extension/preview-rendering',
)]
class PluginPreview
{
public function __invoke(PageContentPreviewRenderingEvent $event): void
{
$this->plugin = $event->getRecord();
...
}
}