Skip to content

Commit

Permalink
[TASK] added custom RTE config
Browse files Browse the repository at this point in the history
  • Loading branch information
codefather007 committed Apr 10, 2024
1 parent 18850b6 commit fc1fa01
Show file tree
Hide file tree
Showing 4 changed files with 130 additions and 21 deletions.
93 changes: 93 additions & 0 deletions local_packages/success/Configuration/RTE/Custom.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
# Default processing options
imports:
- { resource: "EXT:rte_ckeditor/Configuration/RTE/Processing.yaml" }
- { resource: "EXT:rte_ckeditor/Configuration/RTE/Editor/Base.yaml" }
- { resource: "EXT:rte_ckeditor/Configuration/RTE/Editor/Plugins.yaml" }

# Custom configuration for rte
editor:
config:
allowedContent: true

stylesSet:
- name: "Primary Button"
element: "a"
attributes:
class: "btn btn-primary"
- name: "Secondary Button"
element: "a"
attributes:
class: "btn btn-secondary"
- name: "Light Button"
element: "a"
attributes:
class: "btn btn-light"
- name: "Black Button"
element: "a"
attributes:
class: "btn btn-black"
- name: "White Button"
element: "a"
attributes:
class: "btn btn-white"
- name: "Link"
element: "a"
attributes:
class: "link"

format_tags: "p;h1;h2;h3;h4;h5;h6"

toolbar:
items:
- style
- heading
- '|'
- bold
- italic
- underline
- strikethrough
- subscript
- superscript
- '|'
- bulletedList
- numberedList
- blockQuote
- '|'
- alignment
- '|'
- link
- '|'
- sourceEditing
- horizontalLine

justifyClasses:
- text-start
- text-center
- text-end

extraPlugins:
- justify
- find
- bidi
- templates
- wordcount
- textColor

removeButtons:
# - Anchor
- Underline
- Strike
- Table # Remove table button so that the template must be used
- Image
- Templates
# - Styles
- JustifyBlock
templates: "default"

templates_replaceContent: false

processing:
allowTags:
- div
- a
- small
44 changes: 29 additions & 15 deletions local_packages/success/Configuration/TCA/Overrides/tt_content.php
Original file line number Diff line number Diff line change
Expand Up @@ -58,21 +58,35 @@
';

// Text Media
$GLOBALS['TCA']['tt_content']['types']['textmedia']['showitem'] ='
--div--;LLL:EXT:core/Resources/Private/Language/Form/locallang_tabs.xlf:general,
--palette--;;general,
--palette--;;headers, bodytext;LLL:EXT:frontend/Resources/Private/Language/locallang_ttc.xlf:bodytext_formlabel,
--div--;LLL:EXT:core/Resources/Private/Language/Form/locallang_tabs.xlf:media, assets,
--linebreak--, imageorient;LLL:EXT:frontend/Resources/Private/Language/locallang_ttc.xlf:imageorient_formlabel,
--div--;LLL:EXT:core/Resources/Private/Language/Form/locallang_tabs.xlf:appearance,
--palette--;;frames,
--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:notes, rowDescription,
--div--;LLL:EXT:core/Resources/Private/Language/Form/locallang_tabs.xlf:extended,
';
$GLOBALS['TCA']['tt_content']['types']['textmedia'] = [
'showitem' => '
--div--;LLL:EXT:core/Resources/Private/Language/Form/locallang_tabs.xlf:general,
--palette--;;general,
--palette--;;headers, bodytext;LLL:EXT:frontend/Resources/Private/Language/locallang_ttc.xlf:bodytext_formlabel,
--div--;LLL:EXT:core/Resources/Private/Language/Form/locallang_tabs.xlf:media, assets,
--linebreak--, imageorient;LLL:EXT:frontend/Resources/Private/Language/locallang_ttc.xlf:imageorient_formlabel,
--div--;LLL:EXT:core/Resources/Private/Language/Form/locallang_tabs.xlf:appearance,
--palette--;;frames,
--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:notes, rowDescription,
--div--;LLL:EXT:core/Resources/Private/Language/Form/locallang_tabs.xlf:extended,
',
'columnsOverrides' => [
'bodytext' => [
'label' => 'LLL:EXT:success/Resources/Private/Language/locallang_ctypes.xlf:hero.text',
'config' => [
'type' => 'text',
'cols' => 50,
'rows' => 5,
'enableRichtext' => true,
'richtextConfiguration' => 'custom'
],
],
],
];

// Image orient options
$GLOBALS['TCA']['tt_content']['columns']['imageorient']['config']['items'] = [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
'cols' => 50,
'rows' => 5,
'enableRichtext' => true,
'richtextConfiguration' => 'custom',
],
],
'media' => [
Expand Down
13 changes: 7 additions & 6 deletions local_packages/success/ext_localconf.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
* Add custom RTE configurations
*/
$GLOBALS['TYPO3_CONF_VARS']['RTE']['Presets']['minimal'] = 'EXT:success/Configuration/RTE/Minimal.yaml';
$GLOBALS['TYPO3_CONF_VARS']['RTE']['Presets']['custom'] = 'EXT:success/Configuration/RTE/Custom.yaml';

// Include vite generated manifest file (global)
$GLOBALS['TYPO3_CONF_VARS']['EXTENSIONS']['vite_asset_collector']['defaultManifest'] = 'EXT:success/Resources/Public/Vite/.vite/manifest.json';
Expand All @@ -24,11 +25,11 @@
// Add module configuration
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addTypoScriptSetup(
'module.tx_form {
settings {
yamlConfigurations {
110 = EXT:success/Configuration/Sets/LandingPage/Yaml/FormSetup.yaml
}
}
}'
settings {
yamlConfigurations {
110 = EXT:success/Configuration/Sets/LandingPage/Yaml/FormSetup.yaml
}
}
}'
);
});

0 comments on commit fc1fa01

Please sign in to comment.