How can the Toolbar be displayed on a defined Place (div with specific id)?
I tried theme_advanced_toolbar_location : "external" and setting the position of the "mceExternalToolbar" (like suggested here: TinyMCE - external toolbar position) but don't really like this solution since it uses fixed positioning.... Is there a option how to where to place the div.
The docu says for theme_advanced_toolbar_location:
.. adds the toolbar to a DIV element and sets the class of this DIV to "mceExternalToolbar". ... but not if you can change the div. is there maybe a possibilty to change this code?
BR, Stefan
This has been an issue for me a few months ago. All you need to do is to move the external toolbar to the place you want it to be. I wrote a function in one of my plugins. On my page i have created a div with class "externalToolbarWrapper" in which i insert the toolbar. Here is that function. You might need to tweak it a bit, but think it will be of help to you.
showExternalToolbar: function(){ if (this.editor.getParam('theme_advanced_toolbar_location') != 'external') return; if (!document.getElementById('externalToolbarWrapper')) $(document.body).prepend('<div id="externalToolbarWrapper"></div>'); var $toolbar = $('#'+this.editor.id + '_external'); // inserts the external toolbar in the external wrapper $('#externalToolbarWrapper').append('<div id="replacementDiv"></div>'); $('#replacementDiv').replaceWith($toolbar.show()); $toolbar.css('top','0px'); $toolbar.css('display','block'); $('#' + this.editor.id + '_external_close').remove(); $('#' + this.editor.id +'_toolbargroup').css('width', innerWidth || 800); // innerwidth is an integer value },
Update:
You should call it onInit (use the setup configuration parameter here)
setup : function(ed) { ed.onInit.add(function(ed) { // place your code here }); },