Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tinymce html5 containers #35715

Merged
merged 5 commits into from
Nov 13, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions administrator/language/en-GB/plg_editors_tinymce.ini
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ PLG_TINY_FIELD_VALUE_SLIDING="Sliding"
PLG_TINY_FIELD_VALUE_WRAP="Wrap"
PLG_TINY_FIELD_WORDCOUNT_LABEL="Word Count"
PLG_TINY_LEGACY_WARNING="<p>The <a href=\"%s\">TinyMCE Editor Plugin</a> has been updated. Currently it uses your existing configuration. By editing the plugin, you can now assign and customise various layouts to specific user groups.</p><p>Warning: when editing the plugin, you will lose all your previous settings!</p>"
PLG_TINY_MENU_CONTAINER="Container"
PLG_TINY_SET_PRESET_BUTTON_ADVANCED="Use advanced preset"
PLG_TINY_SET_PRESET_BUTTON_MEDIUM="Use medium preset"
PLG_TINY_SET_PRESET_BUTTON_SIMPLE="Use simple preset"
Expand Down
11 changes: 11 additions & 0 deletions plugins/editors/tinymce/tinymce.php
Original file line number Diff line number Diff line change
Expand Up @@ -670,6 +670,17 @@ public function onDisplay(
array('title' => 'Tag', 'value' => 'tag'),
);

$scriptOptions['style_formats'] = array(
array('title' => Text::_('PLG_TINY_MENU_CONTAINER'), 'items' => array(
array('title' => 'article', 'block' => 'article', 'wrapper' => true, 'merge_siblings' => false),
array('title' => 'aside', 'block' => 'aside', 'wrapper' => true, 'merge_siblings' => false),
array('title' => 'section', 'block' => 'section', 'wrapper' => true, 'merge_siblings' => false),
)
)
);

$scriptOptions['style_formats_merge'] = true;

$options['tinyMCE']['default'] = $scriptOptions;

$doc->addScriptOptions('plg_editor_tinymce', $options);
Expand Down