TinyMCE Configuration
Configure the TinyMCE editor through the Combo plugin.
TinyMCE Configuration Options
The tinymce section in your config.yml file controls the TinyMCE editor:
1tinymce:2block_formats: # Block formats in the format dropdown3- 'Paragraph=p'4- 'Heading 2=h2'5- 'Heading 3=h3'6- 'Heading 4=h4'7style_formats: # Custom style formats8- title: 'Buttons'9items:10- title: 'Primary Button'11selector: 'a'12classes: 'btn btn-primary'13- title: 'Secondary Button'14selector: 'a'15classes: 'btn btn-secondary'16- title: 'Inline'17items:18- title: 'Bold'19icon: 'bold'20format: 'bold'21- title: 'Highlight'22inline: 'span'23classes: 'highlight'24toolbar1: # First toolbar row25- 'formatselect'26- 'bold'27- 'italic'28- 'bullist'29- 'numlist'30- 'link'31- 'unlink'32toolbar2: # Second toolbar row33- 'styleselect'34- 'alignleft'35- 'aligncenter'36- 'alignright'37- 'removeformat'38plugins: # TinyMCE plugins to enable39- 'charmap'40- 'hr'41- 'link'42- 'lists'43- 'paste'44- 'tabfocus'45- 'textcolor'46- 'wordpress'47- 'wpautoresize'48- 'wpeditimage'49- 'wpemoji'50- 'wpgallery'51- 'wplink'52- 'wpdialogs'53- 'wptextpattern'54- 'wpview'
Block Formats
block_formats
Controls the block formats available in the format dropdown. Each format is specified as 'Label=tag'.
1tinymce:2block_formats:3- 'Paragraph=p'4- 'Heading 2=h2'5- 'Heading 3=h3'6- 'Heading 4=h4'7- 'Blockquote=blockquote'8- 'Preformatted=pre'
Style Formats
style_formats
Defines custom style formats for the styles dropdown. You can create groups of styles and individual styles.
1tinymce:2style_formats:3- title: 'Buttons'4items:5- title: 'Primary Button'6selector: 'a'7classes: 'btn btn-primary'8- title: 'Secondary Button'9selector: 'a'10classes: 'btn btn-secondary'11- title: 'Inline'12items:13- title: 'Bold'14icon: 'bold'15format: 'bold'16- title: 'Highlight'17inline: 'span'18classes: 'highlight'19- title: 'Blocks'20items:21- title: 'Note Box'22block: 'div'23classes: 'note-box'24wrapper: true
Each style format can have the following parameters:
- title: The name of the style
- selector: The element selector (for existing elements)
- inline: The inline element to create
- block: The block element to create
- classes: CSS classes to apply
- styles: Inline styles to apply
- format: Predefined format to apply
- wrapper: Whether to wrap the selection
- icon: Icon to display in the menu
Toolbars
toolbar1 and toolbar2
Define the buttons to display in the TinyMCE toolbars. You can have up to four toolbars (toolbar1, toolbar2, toolbar3, toolbar4).
1tinymce:2toolbar1:3- 'formatselect'4- 'bold'5- 'italic'6- 'bullist'7- 'numlist'8- 'link'9- 'unlink'10toolbar2:11- 'styleselect'12- 'alignleft'13- 'aligncenter'14- 'alignright'15- 'removeformat'
Common toolbar buttons:
- formatselect: Block format dropdown
- styleselect: Style formats dropdown
- bold: Bold text
- italic: Italic text
- underline: Underline text
- bullist: Bullet list
- numlist: Numbered list
- link: Insert/edit link
- unlink: Remove link
- alignleft: Align left
- aligncenter: Align center
- alignright: Align right
- removeformat: Remove formatting
Plugins
plugins
Specifies which TinyMCE plugins to enable. Plugins add functionality to the editor.
1tinymce:2plugins:3- 'charmap'4- 'hr'5- 'link'6- 'lists'7- 'paste'8- 'tabfocus'9- 'textcolor'10- 'wordpress'11- 'wpautoresize'12- 'wpeditimage'13- 'wpemoji'14- 'wpgallery'15- 'wplink'16- 'wpdialogs'17- 'wptextpattern'18- 'wpview'
Common plugins:
- charmap: Character map
- hr: Horizontal rule
- link: Insert/edit link
- lists: List management
- paste: Paste handling
- textcolor: Text color
- wordpress: WordPress integration
- wpautoresize: Auto resize editor
- wpeditimage: Edit images
- wpgallery: WordPress gallery