diff --git a/README.rst b/README.rst index 01433d7..3e465ba 100644 --- a/README.rst +++ b/README.rst @@ -47,5 +47,4 @@ Resources - https://docs.typo3.org/m/typo3/reference-coreapi/main/en-us/Index.html - - +- https://docs.typo3.org/c/typo3/cms-fluid-styled-content/main/en-us/ diff --git a/localPackages/sitepackage/Configuration/PageTSconfig/Index.tsconfig b/localPackages/sitepackage/Configuration/PageTSconfig/Index.tsconfig new file mode 100644 index 0000000..ba1cc9e --- /dev/null +++ b/localPackages/sitepackage/Configuration/PageTSconfig/Index.tsconfig @@ -0,0 +1 @@ + diff --git a/localPackages/sitepackage/Configuration/PageTSconfig/Mod/Wizards/Admonition.tsconfig b/localPackages/sitepackage/Configuration/PageTSconfig/Mod/Wizards/Admonition.tsconfig new file mode 100644 index 0000000..94f5dd7 --- /dev/null +++ b/localPackages/sitepackage/Configuration/PageTSconfig/Mod/Wizards/Admonition.tsconfig @@ -0,0 +1,35 @@ +// See: https://docs.typo3.org/m/typo3/reference-tsconfig/main/en-us/PageTsconfig/Mod.html + +mod { + wizards.newContentElement.wizardItems.special { + elements { + admonition { + iconIdentifier = content-idea + title = Admonition + description = Displays a hint, note, … + tt_content_defValues { + CType = admonition + header_layout = note + } + } + } + show := addToList(admonition) + } + web_layout.tt_content.preview.admonition = EXT:sitepackage/Resources/Private/Templates/Backend/ContentElements/Admonition.html +} + +// See: https://docs.typo3.org/m/typo3/reference-tsconfig/main/en-us/PageTsconfig/TceForm.html + +TCEFORM.tt_content { + CType.addItems := addToList(admonition) + header_layout.types.admonition { + keepItems = + addItems { + note = LLL:EXT:sitepackage/Resources/Private/Language/locallang.xlf:frontend.content.admonition.header.note + hint = LLL:EXT:sitepackage/Resources/Private/Language/locallang.xlf:frontend.content.admonition.header.hint + caution = LLL:EXT:sitepackage/Resources/Private/Language/locallang.xlf:frontend.content.admonition.header.caution + danger = LLL:EXT:sitepackage/Resources/Private/Language/locallang.xlf:frontend.content.admonition.header.danger + task = LLL:EXT:sitepackage/Resources/Private/Language/locallang.xlf:frontend.content.admonition.header.task + } + } +} diff --git a/localPackages/sitepackage/Configuration/TCA/Overrides/pages.php b/localPackages/sitepackage/Configuration/TCA/Overrides/pages.php new file mode 100644 index 0000000..5d87f50 --- /dev/null +++ b/localPackages/sitepackage/Configuration/TCA/Overrides/pages.php @@ -0,0 +1,9 @@ + [ + 'typeicon_classes' => [ + $contentType => 'content-idea', + ], + ], + 'types' => [ + $contentType => [ + 'showitem' => implode(',', [ + '--div--;LLL:EXT:core/Resources/Private/Language/Form/locallang_tabs.xlf:general', + '--palette--;;general', + 'header_layout', + 'bodytext', + '--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', + ]), + 'columnsOverrides' => [ + 'bodytext' => [ + 'config' => [ + 'enableRichtext' => true, + 'richtextConfiguration' => 'default', + ], + ], + ], + ], + ], + ]); + + \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addTcaSelectItem( + $tableName, + 'CType', + [ + $languagePath . $contentType, + $contentType, + 'content-idea', + 'default' + ], + 'image', + 'after' + ); +})('sitepackage', 'tt_content', 'admonition'); diff --git a/localPackages/sitepackage/Configuration/TypoScript/Setup/TtContent/Admonition.typoscript b/localPackages/sitepackage/Configuration/TypoScript/Setup/TtContent/Admonition.typoscript new file mode 100644 index 0000000..a2d166b --- /dev/null +++ b/localPackages/sitepackage/Configuration/TypoScript/Setup/TtContent/Admonition.typoscript @@ -0,0 +1,4 @@ +tt_content.admonition =< lib.contentElement +tt_content.admonition { + templateName = Admonition +} diff --git a/localPackages/sitepackage/Configuration/TypoScript/constants.typoscript b/localPackages/sitepackage/Configuration/TypoScript/constants.typoscript index 5948c15..6316775 100644 --- a/localPackages/sitepackage/Configuration/TypoScript/constants.typoscript +++ b/localPackages/sitepackage/Configuration/TypoScript/constants.typoscript @@ -1 +1,5 @@ + +styles.templates { + templateRootPath = EXT:sitepackage/Resources/Private/Templates/Frontend/ContentElements/ +} diff --git a/localPackages/sitepackage/Resources/Private/Language/locallang.xlf b/localPackages/sitepackage/Resources/Private/Language/locallang.xlf new file mode 100644 index 0000000..b7be36f --- /dev/null +++ b/localPackages/sitepackage/Resources/Private/Language/locallang.xlf @@ -0,0 +1,23 @@ + + + +
+ + + Note + + + Hint + + + Caution + + + Danger + + + Task + + + + diff --git a/localPackages/sitepackage/Resources/Private/Language/locallang_tca.xlf b/localPackages/sitepackage/Resources/Private/Language/locallang_tca.xlf new file mode 100644 index 0000000..ead07ad --- /dev/null +++ b/localPackages/sitepackage/Resources/Private/Language/locallang_tca.xlf @@ -0,0 +1,11 @@ + + + +
+ + + Admonition + + + + diff --git a/localPackages/sitepackage/Resources/Private/Templates/Backend/ContentElements/Admonition.html b/localPackages/sitepackage/Resources/Private/Templates/Backend/ContentElements/Admonition.html new file mode 100644 index 0000000..a414534 --- /dev/null +++ b/localPackages/sitepackage/Resources/Private/Templates/Backend/ContentElements/Admonition.html @@ -0,0 +1,8 @@ + + + {header_layout} +

{bodytext -> f:format.stripTags()}

+
+ diff --git a/localPackages/sitepackage/Resources/Private/Templates/Frontend/ContentElements/Admonition.html b/localPackages/sitepackage/Resources/Private/Templates/Frontend/ContentElements/Admonition.html new file mode 100644 index 0000000..cc05703 --- /dev/null +++ b/localPackages/sitepackage/Resources/Private/Templates/Frontend/ContentElements/Admonition.html @@ -0,0 +1,18 @@ + + + {f:layout(name: 'Default')} + + + + +