Fix backend preview rendering for video CE

The ContentDataProcessor got a constructor argument.
We migrated to proper DI to not care.
This commit is contained in:
Daniel Siepmann 2021-12-15 08:41:52 +01:00
parent 7d2b8e8b07
commit def2aabcad
3 changed files with 30 additions and 33 deletions

View file

@ -29,6 +29,14 @@ use TYPO3\CMS\Frontend\DataProcessing\FilesProcessor;
class Video extends StandardContentPreviewRenderer
{
private ContentDataProcessor $contentDataProcessor;
public function __construct(
ContentDataProcessor $contentDataProcessor
) {
$this->contentDataProcessor = $contentDataProcessor;
}
public function renderPageModulePreviewContent(GridColumnItem $item): string
{
$record = $item->getRecord();
@ -36,7 +44,7 @@ class Video extends StandardContentPreviewRenderer
$contentObjectRenderer = new ContentObjectRenderer();
$contentObjectRenderer->start($record, 'tt_content');
$record = (new ContentDataProcessor())->process($contentObjectRenderer, [
$record = $this->contentDataProcessor->process($contentObjectRenderer, [
'dataProcessing.' => [
'10' => FilesProcessor::class,
'10.' => [

View file

@ -21,6 +21,9 @@ services:
DanielSiepmann\DsSite\Frontend\RssFeed\XmlSitemapRenderer:
public: true
DanielSiepmann\DsSite\Backend\PreviewRenderer\Video:
public: true
DanielSiepmann\DsSite\Frontend\DataProcessing\CategoriesCounts:
public: true
arguments:

View file

@ -1,41 +1,27 @@
<html xmlns:f="http://typo3.org/ns/TYPO3/CMS/Fluid/ViewHelpers"
xmlns:be="http://typo3.org/ns/TYPO3/CMS/Backend/ViewHelpers"
data-namespace-typo3-fluid="true">
<a href="{be:uri.editRecord(
uid: uid,
table: 'tt_content'
)}">
<f:for each="{videos}" as="video">
<figure>
<video controls preload="metadata">
<source src="/{video.publicUrl}" type="video/mp4">
</video>
<figcaption>
<p>Video v{video.originalFile.uid}: {video.title}</p>
<f:for each="{videos}" as="video">
<figure>
<video controls {f:if(condition: video.properties.poster.publicUrl, then: 'poster="{video.properties.poster.publicUrl}"')}>
<source src="{video.publicUrl}" type="video/mp4">
</video>
<figcaption>
<a href="{be:uri.editRecord(
uid: uid,
table: 'tt_content'
)}">
<p>
Video v{video.originalFile.uid}: {video.title}<br>
Size: {video.size -> f:format.bytes(decimals: 2)}
<f:if condition="{video.properties.youtube}">
<f:then>
The Video is available on YouTube: <f:link.typolink parameter="https://www.youtube.com/watch?v=EZkwnqb-4vk" target="_blank">https://www.youtube.com/watch?v={video.properties.youtube}</f:link.typolink>.
</f:then>
<f:else>
The Video is not available on YouTube
</f:else>
<br>
YouTube: {video.properties.youtube}
</f:if>
</p>
<p>{video.description -> f:format.nl2br()}</p>
<p>
<f:if condition="{video.properties.poster}">
<f:then>
<f:image image="{video.properties.poster}" height="210" width="375" />
</f:then>
<f:else>
No poster configured.
</f:else>
</f:if>
</p>
</figcaption>
</figure>
</f:for>
</a>
</a>
</figcaption>
</figure>
</f:for>
</html>