• Hi there. I was interested in adding additional buttons to the TinyMCE editor in WP 2.0.3. I found a post in the forums here. This was what I was looking for, and with the TinyMCE docs, I found a reference for the supported additional functions/buttons.

    My problem is, at lower resolutions (800×600) the new buttons are causing the content textarea’s width to be too wide and result in some overlap with the post option boxes on the right. Here’s a pic to better demonstrate.

    Is there any way to have the editor wrap the buttons as the window resizes, or can I specify some sort of layout (insert a break or something) for the buttons? I’ve looked at some of the WP code for the post page, but I thought I’d see if any of the pros on here could offer advice before I went too nuts overlooking something that may be obvious. Any and all help is greatly appreciated.

Viewing 4 replies - 1 through 4 (of 4 total)
  • Thread Starter speedphreak

    (@speedphreak)

    Figured out the answer to my own question. Went through the TinyMCE docs some more and found this. Then found looked at this section of code in the /wp-includes/js/tinymce/tiny_mce_gzip.php file.

    $mce_buttons = apply_filters('mce_buttons', array('bold', 'italic', 'strikethrough', 'separator', 'bullist', 'numlist', 'outdent', 'indent', 'separator', 'justifyleft', 'justifycenter', 'justifyright' ,'separator', 'link', 'unlink', 'image', 'wordpress', 'separator', 'undo', 'redo', 'code', 'wphelp', 'formatselect', 'fontselect', 'fontsizeselect'));
    $mce_buttons = implode($mce_buttons, ',');
    $mce_buttons_2 = apply_filters('mce_buttons_2', array());
    $mce_buttons_2 = implode($mce_buttons_2, ',');
    $mce_buttons_3 = apply_filters('mce_buttons_3', array());
    $mce_buttons_3 = implode($mce_buttons_3, ',');
    $mce_browsers = apply_filters('mce_browsers', array('msie', 'gecko', 'opera'));
    $mce_browsers = implode($mce_browsers, ',');
    ?>

    initArray = {
    mode : "specific_textareas",
    textarea_trigger : "title",
    width : "100%",
    theme : "advanced",
    theme_advanced_buttons1 : "<?php echo $mce_buttons; ?>",
    theme_advanced_buttons2 : "<?php echo $mce_buttons_2; ?>",
    theme_advanced_buttons3 : "<?php echo $mce_buttons_3; ?>",

    Saw where the $mce_buttons_n variable was getting set and played with it. Does exactly what the docs say. Allows you to specify the rows for the buttons. I’ll use this to modify my button layout.

    If you looked at this to offer help, thanks! If you looked for a solution to a similar question, hope this helps.

    screamatme

    (@screamatme)

    I’m having the same exact problem, I’m running the latest version of WordPress v.2.0.5. I tried figuring the entire thing out on my own, and even went to the extent of using your exact code listed above. The only difference between the two of us is the fact, I’m running my system at 1024. Any ideas? Thanks so much!

    -Matt

    I use a plugin to add buttons. You can see the code at https://wpmu.pastebin.ca/172975.

    Cori,

    I get a 404 on that pastebin. Any other way of seeing it.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Adding additional and wrapping buttons in TinyMCE Editor’ is closed to new replies.