tags:

views:

39

answers:

2

How do I move the toolbar to the top in TinyMCE Simple theme? Thanks

A: 
tinyMCE.init({
    mode : "textareas",
    theme : "simple"
    theme_simple_toolbar_location : "top"
});

The important bit is the "toolbar_location" parameter.

Dean Harding
Doesn't work for me. Thanks anyway.
Honza Pokorny
+2  A: 

The toolbar can only be moved to top when using theme : advanced in TinyMCE. There is no theme_simple_toolbar_location but a theme_advanced_toolbar_location. See documentation here http://wiki.moxiecode.com/index.php/TinyMCE:Configuration/theme_advanced_toolbar_location.

What you can do is to serve the editor as theme : advanced and then customize the buttons by using the theme_advanced_buttons_1_n property. It's documented here http://wiki.moxiecode.com/index.php/TinyMCE:Configuration/theme_advanced_buttons_1_n.

Example:

The code in the example is not tested, but it should work. It will show an editor with the buttons for Bold, Italic and Underline at the top.

tinyMCE.init({
  mode : "textareas",
  theme : "advanced",
  theme_advanced_toolbar_location : "top",
  theme_advanced_buttons1 : "bold,italic,underline",
  theme_advanced_buttons2 : "",
  theme_advanced_buttons3 : ""
});

So the answer would be: one cannot move the buttons when using theme : simple.

Erik Töyrä
This is true. Since you haven't specified any original code, the docs also mention that the layout manager must be set to "SimpleLayout" this is the default, but since no code was shown by @Honza Pokorny then just make sure that there is either no layout manager specified which would default to SimpleLayout or you are not using another layout manager. This would case it not too work.
CitadelCSAlum