Using the TinyMCE editor standalone it is possible to configure the toolbar to have an external location: the toolbar appears when you click on the appropriate textarea and you can then control where this toolbar appears (theme_advanced_toolbar_location : "external" - see: http://tinymce.moxiecode.com/tryit/external_toolbar.php). WYSIWYG does not give you this option - only giving you the options of 'top' and 'bottom'. I did try adding this option by using hook_form_alter: I could then use WYSIWYG to set up an external toolbar - unfortunately the resulting toolbar had no buttons in it. The only way I can currently appear to do this is by including and configuring TinyMCE editor in my theme, which is a shame as the convenience of the WYSIWYG module is lost.

Comments

twod’s picture

Getting this to work would partially depend on #277954: Allow to sort editor buttons to let us get rid of this snippet in tinymce-3.js:

55   ed.onPostRender.add(function (ed) {
 56     var $toolbar = $('<div class="wysiwygToolbar"></div>');
 57     $('#' + ed.editorContainer + ' table.mceToolbar > tbody > tr > td').each(function () {
 58       $('<div></div>').addClass(this.className).append($(this).children()).appendTo($toolbar);
 59     });
 60     $('#' + ed.editorContainer + ' table.mceLayout td.mceToolbar').append($toolbar);
 61     $('#' + ed.editorContainer + ' table.mceToolbar').remove();
 62   });

If you comment that out and implement hook_wsysiwyg_editor_settings_alter() like this:

if ($context['profile']->editor == 'tinymce') {
  $settings['theme_advanced_toolbar_location'] = 'external';
}

It'll work, at least when there's just a single WYSIWYG-enabled field.

I don't know what happens if there are more fields with varying configurations of TinyMCE enabled at the same time. Since the button configuration is still defined the same way, I hope the editor can keep track of which toolbar goes where.

neilt17’s picture

Great, thank you very much for this. I've tried it out and got it working - it also seems to work with multiple editors on a page.