Skip to content

Instantly share code, notes, and snippets.

@kitzberger
Created September 17, 2025 14:28
Show Gist options
  • Save kitzberger/4978d233dfb4114b1924d6cc60565d8c to your computer and use it in GitHub Desktop.
Save kitzberger/4978d233dfb4114b1924d6cc60565d8c to your computer and use it in GitHub Desktop.
TYPO3 PageModule Preview

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();
        ...
    }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment