(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.