Important changes to Tiny Cloud pricing > Find out more

Code plugin

Edit your content's HTML source.

Contribute to this page
+ toolbar button + menu item

This plugin adds a toolbar button that allows a user to edit the HTML code hidden by the WYSIWYG view. It also adds the menu item Source code under the Tools menu.

Basic setup

tinymce.init({
  selector: 'textarea',  // change this value according to your HTML
  plugins: 'code',
  toolbar: 'code',
  menubar: 'tools'
});

Toolbar buttons

The Code plugin provides the following toolbar buttons:

Toolbar button identifier Description
code Opens the code dialog

These toolbar buttons can be added to the editor using:

Menu items

The Code plugin provides the following menu items:

Menu item identifier Default Menu Location Description
code View Opens the code dialog.

These menu items can be added to the editor using:

Commands

The Code plugin provides the following JavaScript command.

Command Description
mceCodeEditor Opens the code editor dialog.

Example

tinymce.activeEditor.execCommand('mceCodeEditor');

Can't find what you're looking for? Let us know.

Except as otherwise noted, the content of this page is licensed under the Creative Commons BY-NC-SA 3.0 License, and code samples are licensed under the Apache 2.0 License.