Feature #100723
Updated by Jochen Roth over 1 year ago
Im overriding a backend template using page.tsconfig and added two buttons. These buttons should show up depending on if a CE is in the basket or not. <pre> templates.typo3/cms-backend.1682083422 = vendor/package-name:Resources/Private/TemplateOverrides </pre> PageContentPreviewRenderingEventListener.php <pre> public function __invoke(PageContentPreviewRenderingEvent $event): void { $record = $event->getRecord(); $item = $this->basketItem((string)$record['uid'], $event->getTable(), (int)$record['uid']); ############# SET ADDITIONAL INFORMATION FOR THE RECORD $record['inBasket'] = (int)$this->basket->contains($item); $event->setRecord($record); } </pre> <pre> This does not work in Resources/Private/Partials/PageLayout/Record.html when {item.record.inBasket} is used before {item.preview}. Current workaround: <pre> <f:variable name="triggerPageContentPreviewRenderingEventListener">{item.preview}</f:variable> </pre>