Last active
March 1, 2020 22:58
-
-
Save jules0x/f3fd70c8811a47452430 to your computer and use it in GitHub Desktop.
# TinyMCE custom classes
### Apply custom classes to html elements via a dropdown
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<? | |
$htmlEditorConfig = HtmlEditorConfig::get('cms'); | |
// Add half' and 'third' wrappers to tinyMCE (will appear in styles drop-down). | |
$htmlEditorConfig->setOption('style_formats', [ | |
[ | |
'title' => 'Half (md)', | |
'block' => 'div', | |
'wrapper' => true, | |
'classes' => 'pure-u-md-6', | |
'merge_siblings' => false | |
], | |
[ | |
'title' => 'Third (md)', | |
'block' => 'div', | |
'wrapper' => true, | |
'classes' => 'pure-u-md-4', | |
'merge_siblings' => false | |
] | |
] | |
); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment