diff --git a/Classes/Backend/PreviewRenderer/Video.php b/Classes/Backend/PreviewRenderer/Video.php
new file mode 100644
index 0000000..fb1b0d1
--- /dev/null
+++ b/Classes/Backend/PreviewRenderer/Video.php
@@ -0,0 +1,55 @@
+
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+ * 02110-1301, USA.
+ */
+
+use TYPO3\CMS\Backend\Preview\StandardContentPreviewRenderer;
+use TYPO3\CMS\Backend\View\BackendLayout\Grid\GridColumnItem;
+use TYPO3\CMS\Frontend\ContentObject\ContentDataProcessor;
+use TYPO3\CMS\Frontend\ContentObject\ContentObjectRenderer;
+use TYPO3\CMS\Frontend\DataProcessing\FilesProcessor;
+
+class Video extends StandardContentPreviewRenderer
+{
+ public function renderPageModulePreviewContent(GridColumnItem $item): string
+ {
+ $record = $item->getRecord();
+
+ $contentObjectRenderer = new ContentObjectRenderer();
+ $contentObjectRenderer->start($record, 'tt_content');
+
+ $record = (new ContentDataProcessor())->process($contentObjectRenderer, [
+ 'dataProcessing.' => [
+ '10' => FilesProcessor::class,
+ '10.' => [
+ 'references.' => [
+ 'fieldName' => 'media',
+ ],
+ 'as' => 'videos',
+ ],
+ ],
+ ], $record);
+
+ $item->setRecord($record);
+
+ return parent::renderPageModulePreviewContent($item);
+ }
+}
diff --git a/Configuration/PageTSconfig/Mod/Wizards/0_NewContentElement.tsconfig b/Configuration/PageTSconfig/Mod/Wizards/0_NewContentElement.tsconfig
index 188cf4e..a9b248a 100644
--- a/Configuration/PageTSconfig/Mod/Wizards/0_NewContentElement.tsconfig
+++ b/Configuration/PageTSconfig/Mod/Wizards/0_NewContentElement.tsconfig
@@ -1,6 +1,6 @@
mod.wizards.newContentElement.wizardItems {
common {
- show = text, image
+ show = text, image, video
elements {
image {
@@ -26,6 +26,6 @@ mod.wizards.newContentElement.wizardItems {
}
TCEFORM.tt_content {
CType {
- keepItems := addToList(text, image, menu_abstract, menu_subpages)
+ keepItems := addToList(text, image, video, menu_abstract, menu_subpages)
}
}
diff --git a/Configuration/PageTSconfig/Mod/Wizards/Video.tsconfig b/Configuration/PageTSconfig/Mod/Wizards/Video.tsconfig
new file mode 100644
index 0000000..d7f2719
--- /dev/null
+++ b/Configuration/PageTSconfig/Mod/Wizards/Video.tsconfig
@@ -0,0 +1,19 @@
+mod {
+ wizards.newContentElement.wizardItems.common {
+ elements {
+ video {
+ iconIdentifier = content-media
+ title = Video
+ description = Displays a Video
+ tt_content_defValues {
+ CType = video
+ }
+ }
+ }
+ show := addToList(video)
+ }
+ web_layout.tt_content.preview.video = EXT:ds_site/Resources/Private/Templates/Backend/ContentElements/Video.html
+}
+TCEFORM.tt_content {
+ CType.keepItems := addToList(video)
+}
diff --git a/Configuration/TCA/Overrides/tt_content_video.php b/Configuration/TCA/Overrides/tt_content_video.php
new file mode 100644
index 0000000..870de24
--- /dev/null
+++ b/Configuration/TCA/Overrides/tt_content_video.php
@@ -0,0 +1,52 @@
+ [
+ 'typeicon_classes' => [
+ $contentType => 'content-media',
+ ],
+ ],
+ 'types' => [
+ $contentType => [
+ 'showitem' => implode(',', [
+ '--div--;LLL:EXT:core/Resources/Private/Language/Form/locallang_tabs.xlf:general',
+ '--palette--;;general',
+ ' --palette--;;headers',
+ 'media',
+ '--div--;LLL:EXT:frontend/Resources/Private/Language/locallang_ttc.xlf:tabs.appearance',
+ '--palette--;;frames',
+ '--palette--;;appearanceLinks',
+ '--div--;LLL:EXT:core/Resources/Private/Language/Form/locallang_tabs.xlf:language',
+ '--palette--;;language',
+ '--div--;LLL:EXT:core/Resources/Private/Language/Form/locallang_tabs.xlf:access',
+ '--palette--;;hidden',
+ '--palette--;;access',
+ '--div--;LLL:EXT:core/Resources/Private/Language/Form/locallang_tabs.xlf:categories',
+ 'categories',
+ '--div--;LLL:EXT:core/Resources/Private/Language/Form/locallang_tabs.xlf:notes',
+ 'rowDescription',
+ '--div--;LLL:EXT:core/Resources/Private/Language/Form/locallang_tabs.xlf:extended',
+ ]),
+ 'previewRenderer' => Video::class,
+ ],
+ ],
+ ]);
+
+ \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addTcaSelectItem(
+ $tableName,
+ 'CType',
+ [
+ $languagePath . $contentType,
+ $contentType,
+ 'content-media',
+ 'default'
+ ],
+ 'image',
+ 'after'
+ );
+})('ds_site', 'tt_content', 'video');
diff --git a/Configuration/TypoScript/Setup/ContentElements/Video.typoscript b/Configuration/TypoScript/Setup/ContentElements/Video.typoscript
new file mode 100644
index 0000000..dd507e4
--- /dev/null
+++ b/Configuration/TypoScript/Setup/ContentElements/Video.typoscript
@@ -0,0 +1,16 @@
+tt_content.video =< lib.contentElement
+tt_content.video {
+ templateName = Video
+
+ dataProcessing {
+ 10 = TYPO3\CMS\Frontend\DataProcessing\FilesProcessor
+ 10 {
+ references.fieldName = media
+ as = videos
+ }
+ }
+
+ stdWrap {
+ editIcons := appendString(media)
+ }
+}
diff --git a/Resources/Private/Language/locallang_tca.xlf b/Resources/Private/Language/locallang_tca.xlf
index 06ba84e..a0d3941 100644
--- a/Resources/Private/Language/locallang_tca.xlf
+++ b/Resources/Private/Language/locallang_tca.xlf
@@ -9,6 +9,9 @@
+
+
+