How Do I Get Multiple CKEditor Instances to Share the Same Toolbar?

This website contains links to software which is either no longer maintained or will be supported only until the end of 2019 (CKFinder 2). For the latest documentation about current CKSource projects, including software like CKEditor 4/CKEditor 5, CKFinder 3, Cloud Services, Letters, Accessibility Checker, please visit the new documentation website.

If you look for an information about very old versions of CKEditor, FCKeditor and CKFinder check also the CKEditor forum, which was closed in 2015. If not, please head to StackOverflow for support.

(Article contents added)
 
(Links to UG added)
Line 1: Line 1:
 
{{#CUSTOMTITLE:How Do I Get Multiple CKEditor Instances to Share the Same Toolbar?}}
 
{{#CUSTOMTITLE:How Do I Get Multiple CKEditor Instances to Share the Same Toolbar?}}
Use the <code>[http://docs.cksource.com/ckeditor_api/symbols/CKEDITOR.config.html#.sharedSpaces sharedSpaces]</code> configuration value to define the page element that will contain the shared toolbar (<code>top</code>) and the elements path (<code>bottom</code>) for the editor instances.
+
Use the <code>[http://docs.cksource.com/ckeditor_api/symbols/CKEDITOR.config.html#.sharedSpaces sharedSpaces]</code> configuration value to define the page element that will contain the shared [[CKEditor_3.x/Users_Guide/Interface/Toolbar|toolbar]] (<code>top</code>) and the [[CKEditor_3.x/Users_Guide/Interface/Elements_Path|elements path]] (<code>bottom</code>) for the editor instances.
  
 
<source lang="javascript">
 
<source lang="javascript">

Revision as of 16:31, 9 March 2011

Use the sharedSpaces configuration value to define the page element that will contain the shared toolbar (top) and the elements path (bottom) for the editor instances.

// Place the toolbar inside the element with an ID of "myToolbar" and the elements path
// in the element with an ID of "myElementsPath".
config.sharedSpaces =
{
	top : 'myToolbar',
	bottom : 'myElementsPath'
};

Remember that you can share either both the toolbar and the elements path or just one of these elements. You can also combine editor instances with different configurations (with shared elements and without them) on one page.

For a full working example of sharing the editor interface refer to the Shared Toolbars (sharedspaces.html) sample located in the _samples folder of the CKEditor installation package.