From ff77768a4f07038f63cfa369b4d4a06957cba820 Mon Sep 17 00:00:00 2001 From: "lina.wolf" Date: Sat, 7 Sep 2024 14:01:58 +0200 Subject: [PATCH] [FEATURE] Add a basic content element Related: https://github.com/TYPO3-Documentation/Changelog-To-Doc/issues/801,https://github.com/TYPO3-Documentation/Changelog-To-Doc/issues/1013 --- Configuration/Sets/Examples/setup.typoscript | 3 +- .../Overrides/tt_content_basic_content.php | 46 +++++++++++++++++++ .../CustomContentElements/Basic.typoscript | 6 +++ .../ContentElements/BasicContent.html | 12 +++++ 4 files changed, 65 insertions(+), 2 deletions(-) create mode 100644 Configuration/TCA/Overrides/tt_content_basic_content.php create mode 100644 Configuration/TypoScript/CustomContentElements/Basic.typoscript create mode 100644 Resources/Private/Templates/ContentElements/BasicContent.html diff --git a/Configuration/Sets/Examples/setup.typoscript b/Configuration/Sets/Examples/setup.typoscript index 6c91d3c..8908d4a 100644 --- a/Configuration/Sets/Examples/setup.typoscript +++ b/Configuration/Sets/Examples/setup.typoscript @@ -3,8 +3,7 @@ @import 'EXT:examples/Configuration/TypoScript/TSref/*.typoscript' -@import 'EXT:examples/Configuration/TypoScript/CustomContentElements/Step1.typoscript' -@import 'EXT:examples/Configuration/TypoScript/CustomContentElements/Step2.typoscript' +@import 'EXT:examples/Configuration/TypoScript/CustomContentElements/*.typoscript' @import 'EXT:examples/Configuration/TypoScript/DataProcessors/General.typoscript' @import 'EXT:examples/Configuration/TypoScript/DataProcessors/Processors/*.typoscript' diff --git a/Configuration/TCA/Overrides/tt_content_basic_content.php b/Configuration/TCA/Overrides/tt_content_basic_content.php new file mode 100644 index 0000000..b16d0f0 --- /dev/null +++ b/Configuration/TCA/Overrides/tt_content_basic_content.php @@ -0,0 +1,46 @@ + 'Example - basic content', + 'value' => $key, + 'group' => 'default', + ], + 'textmedia', + 'after', + ); + + // Configure the default backend fields for the content element + $GLOBALS['TCA']['tt_content']['types'][$key] = [ + 'showitem' => ' + --palette--;;headers, + bodytext, + ', + ]; +}); diff --git a/Configuration/TypoScript/CustomContentElements/Basic.typoscript b/Configuration/TypoScript/CustomContentElements/Basic.typoscript new file mode 100644 index 0000000..9c2d0ec --- /dev/null +++ b/Configuration/TypoScript/CustomContentElements/Basic.typoscript @@ -0,0 +1,6 @@ +tt_content { + examples_basiccontent =< lib.contentElement + examples_basiccontent { + templateName = BasicContent + } +} diff --git a/Resources/Private/Templates/ContentElements/BasicContent.html b/Resources/Private/Templates/ContentElements/BasicContent.html new file mode 100644 index 0000000..21f5eac --- /dev/null +++ b/Resources/Private/Templates/ContentElements/BasicContent.html @@ -0,0 +1,12 @@ + + + + +
+ + {data.bodytext} + +
+ +
+