WordPress.org

Ready to get started?Download WordPress

Forums

TinyMCE Wishlist (33 posts)

  1. Bricolou
    Member
    Posted 8 years ago #

    The new TinyMCE Wysiwyg feature is excellent but is there a way to use its table editing feature in WordPress?

  2. Bricolou
    Member
    Posted 8 years ago #

    OK, I found out how to add a table insertion button to the wysiwyg
    editor toolbar. If anyone's interested, here's how I managed to
    do it...

    Download the plugin "table.zip" from here
    http://mudbomb.com/images/files/table.zip

    Go to wp-includes/js/tinyMCE/plugins/ and
    drop the decompressed "table" directory.

    Go back to the "tinyMCE" directory.

    Open "tiny_mce_gzip.js"

    line 84: add 'table' to the array list...
    $plugins = apply_filters('mce_plugins', array('wordpress', 'autosave', 'wphelp', 'table'));

    line 110: add 'table', to the list where you want the button
    to appear...
    $mce_buttons = apply_filters('mce_buttons', array('bold', 'italic', 'strikethrough', 'separator', 'bullist', 'numlist', 'outdent', 'indent', 'separator', 'justifyleft', 'justifycenter', 'justifyright' ,'separator', 'link', 'unlink', 'image', 'table', 'wordpress', 'separator', 'undo', 'redo', 'code', 'wphelp'));

    Refresh and the plugin should work in your textareas.
    It works for me.

  3. Bricolou
    Member
    Posted 8 years ago #

    Even better, line 110 put "tablecontrols" instead of "table"
    or forget about modifying this line and change line 112 as such
    $mce_buttons_2 = apply_filters('mce_buttons_2',
    array('tablecontrols'));
    You'll get the set of controls on a second line of the toolbar.

  4. TerranceDC
    Member
    Posted 8 years ago #

    Spellcheck! My kingdom for a spellcheck! I haven't seen any of the regular spellcheck plugins on the 2.0 compatability list. WYSIWYG is nice, but without spellcheck it's of limited use to me. I tried to use the Google toolbar plugin for spellcheck, but that inserts a lot of weird code into the WYSIWYG that I have to go back and delete.

    Any suggestions out there?

  5. Mike Koepke
    Member
    Posted 8 years ago #

    If you go to the TinyMCE site (http://tinymce.moxiecode.com/) and download the full 2.01 release, there is the IESpell plugin that you can add to your editor.

    To easily add buttons and plugins to WordPress, check out hte "Advanced editing for WordPress 2.0" plugin" (http://blog.labnotes.org/2005/12/26/advanced-editing-for-wordpress-20/).
    It easily allows you to add extend the rather minimal WP 2.0 implementation. This plugin has come in very handy.

    It is easy to take this plugin and also add a 2nd or 3rd line of buttons.

    Simply add another filter for mce_buttons_2, and if you need three lines, also mce_buttons_3:

    add_filter("mce_buttons_2", "extended_editor_mce_buttons2", 0);

    function extended_editor_mce_buttons2($buttons) {
    return array( /* second row buttons */ );
    }

  6. TerranceDC
    Member
    Posted 8 years ago #

    I'll try it, but editing plugins is somewhat new territory for me.

  7. dbasulto
    Member
    Posted 8 years ago #

    hope they add quote button :)

  8. Mike Koepke
    Member
    Posted 8 years ago #

    dbasulto,

    the Indent button automatically converts to a blockquote for you.

    TerranceDC,

    It is very easy. You can use the Plugin Editor off Admin->Plugins. Here is what I am using.

    if (isset($wp_version)) {
    add_filter("mce_plugins", "extended_editor_mce_plugins", 0);
    add_filter("mce_buttons", "extended_editor_mce_buttons", 0);
    add_filter("mce_buttons_2", extended_editor_mce_buttons2", 0);
    add_filter("mce_buttons_3", "extended_editor_mce_buttons3", 0);
    }

    function extended_editor_mce_plugins($plugins) {
    array_push($plugins, "table", "fullscreen", "emotions", "advlink", "advimage", "searchreplace", "iespell");
    return $plugins;
    }

    function extended_editor_mce_buttons($buttons) {
    return array(
    "cut", "copy", "paste", "separator", "undo", "redo", "separator", "search,replace", "separator", "iespell", "charmap", "emotions", "separator", "link", "unlink", "anchor", "image", "separator", "removeformat", "code", "fullscreen", "wordpress", "wphelp");

    function extended_editor_mce_buttons2($buttons) {
    return array(
    "formatselect", "bold", "italic", "underline", "strikethrough", "sub", "sup", "separator", "justifyleft", "justifycenter", "justifyright", "justifyfull", "separator", "bullist", "numlist", "outdent", "indent", "separator", "forecolor", "backcolor", "separator", "hr", );
    }

    function extended_editor_mce_buttons3($buttons) {
    return array(
    "tablecontrols");
    }

    You need to make sure you add the plugins into the Tinymve js plugins directory.

  9. TerranceDC
    Member
    Posted 8 years ago #

    It depends on your definition of "easy."

    The thing is, to add the TinyMCE editor, you have to be comfortable editing files .js files, etc. I tried it. I downloaded the editor, uploaded the plugin to the TinyMCE plugins directory and added the code in the READ ME file for the plugin to the TinyMCE file.

    tinyMCE.init({
    theme : "advanced",
    mode : "textareas",
    plugins : "iespell",
    theme_advanced_buttons3_add : "iespell"
    });

    I got nothing. I went back to my write screen and I got nothing. No button on my editor. Nothing. Maybe I didn't add the code to the right place in the file, but the directions are surprisingly short and not specific about where to put the code. It assumes a level a knowledge I don't have.

    So, if you're a developer, a programmer, etc., this will be easy for you. I'm not. I'm just a writer, for whom a spellcheck would have some value. My solution is either to simply not use the WYSIWYG editor (which is a shame, because it's a valuable feature) and rely on the spellcheck in the Google toolbar or downgrade to an older version of Firefox so I can use the older spellcheck extensions. At least, until someone updates a plugin or the feature gets added to the next version of WordPress, so it's easy for a non-developer or non-programmer to add the feature.

  10. TerranceDC
    Member
    Posted 8 years ago #

    I either need to become a programer, or stop being an early adopter.

    Mike, I've tried the code you posted. If I just use the part for the plugins, it works fine.

    When I add this

    if (isset($wp_version)) {
    add_filter("mce_plugins", "extended_editor_mce_plugins", 0);
    add_filter("mce_buttons", "extended_editor_mce_buttons", 0);
    add_filter("mce_buttons_2", extended_editor_mce_buttons2", 0);
    add_filter("mce_buttons_3", "extended_editor_mce_buttons3", 0);
    }

    I get the following error message.

    Parse error: parse error, unexpected T_CONSTANT_ENCAPSED_STRING in /usr/www/users/terrance/wp-content/plugins/advacned-wysiwyg.php on line 17

    So, I revert back to the original plugin code, then add the plugins for TinyMCE. I have all the buttons now, but I have no idea how to get them on separate rows instead of all in one.

    At present, this is what I have in the plugin editor.


    if (isset($wp_version)) {
    add_filter("mce_plugins", "extended_editor_mce_plugins", 0);
    add_filter("mce_buttons", "extended_editor_mce_buttons", 0);
    add_filter("mce_buttons_2", "extended_editor_mce_buttons_2", 0);
    add_filter("mce_buttons_3", "extended_editor_mce_buttons_3", 0);
    }

    function extended_editor_mce_plugins($plugins) {
    array_push($plugins, "table", "fullscreen", "iespell");
    return $plugins;
    }

    function extended_editor_mce_buttons($buttons) {
    return array(
    "formatselect", "bold", "italic", "underline", "strikethrough", "separator",
    "bullist", "numlist", "indent", "outdent", "separator",
    "cut", "copy", "paste", "undo", "redo", "separator", "wphelp");
    }

    function extended_editor_mce_buttons_2($buttons) {
    return array(
    "justifyleft", "justifycenter", "justifyright", "justifyfull", "separator", "link", "unlink", "anchor", "image", "hr", "separator");
    // Add buttons on the second toolbar line
    return $buttons;
    }

    function extended_editor_mce_buttons_3($buttons) {
    return array(
    "table", "sub", "sup", "forecolor", "backcolor", "charmap", "separator", "code", "fullscreen", "wordpress");
    // Add buttons on the third toolbar line
    return $buttons;
    }
    ?>

    This is what my WYSIWYG editor bar looks like:

    http://i25.photobucket.com/albums/c70/TerranceDC/wordpress.jpg

  11. Mike Koepke
    Member
    Posted 8 years ago #

    In your line add_filter("mce_buttons_2", extended_editor_mce_buttons2", 0); you need a " before the extended_editor_mce_buttons2"

    change to:

    add_filter("mce_buttons_2", "extended_editor_mce_buttons2", 0);

  12. TerranceDC
    Member
    Posted 8 years ago #

    Recopied and repasted your code, with the above correction.

    Got this.

    '
    Parse error: parse error, unexpected $ in /usr/www/users/terrance/wp-content/plugins/advacned-wysiwyg.php on line 38
    '

    I've spent the last two hours or more trying to make this work. To be honest, I'd rather have spent that time writing a post or something. It'll probably take me hours more to get it to work, if at all, given my skill level with the programmming involved.

    I think it's best I give up until someone makes it easy for a non-programmer to do it. As it stands now, I'll probalby delete the plugin and try to get my WYSIWYG editor back to its original state at intallation. If I can do that, I may be able to jerryrig a spellcheck some other way. I think it will mean reverting back to an older version of Firefox and using an extension.

    If there's anyone on the WordPress development team reading this, I'd like to suggest making the iespell plugin for TinyMCE an included part of the WP installation. It would add a lot of extra value to the

  13. Mike Koepke
    Member
    Posted 8 years ago #

    Function:

    function extended_editor_mce_buttons($buttons) {
    return array(
    "formatselect", "bold", "italic", "underline", "strikethrough", "separator",
    "bullist", "numlist", "indent", "outdent", "separator",
    "cut", "copy", "paste", "undo", "redo", "separator", "wphelp");
    }

    Add the return $buttons; before the closing brace

  14. TerranceDC
    Member
    Posted 8 years ago #

    Well, almost.

    I tried it again. But this time a shift+refresh was what it took to get the rows of buttons to show up. I now have an entire array of features. Except spellcheck, which is what I wanted most. For some reason, the spellcheck button doesn't show up. Of course, I don't know what's wrong. I've uploaded the plugin to the TinyMCE directory in wp-includes/js.

    If I'm reading the plugin correctly, it's supposed to show up on the top row. Right after the search-replace button. But it ain't there.

    http://i25.photobucket.com/albums/c70/TerranceDC/wysiwyg.jpg

    This is now what the plugin code looks like.

    if (isset($wp_version)) {
    add_filter("mce_plugins", "extended_editor_mce_plugins", 0);
    add_filter("mce_buttons", "extended_editor_mce_buttons", 0);
    add_filter("mce_buttons_2", "extended_editor_mce_buttons2", 0);
    add_filter("mce_buttons_3", "extended_editor_mce_buttons3", 0);
    }

    function extended_editor_mce_plugins($plugins) {
    array_push($plugins, "table", "fullscreen", "emotions", "advlink", "advimage", "searchreplace", "iespell");
    return $plugins;
    }

    function extended_editor_mce_buttons($buttons) {
    return array(
    "cut", "copy", "paste", "separator", "undo", "redo", "separator", "search,replace", "separator", "iespell", "charmap", "emotions", "separator", "link", "unlink", "anchor", "image", "separator", "removeformat", "code", "fullscreen", "wordpress", "wphelp");
    return $buttons;
    }

    function extended_editor_mce_buttons2($buttons) {
    return array(
    "formatselect", "bold", "italic", "underline", "strikethrough", "sub", "sup", "separator", "justifyleft", "justifycenter", "justifyright", "justifyfull", "separator", "bullist", "numlist", "outdent", "indent", "separator", "forecolor", "backcolor", "separator", "hr", );
    return $buttons;
    }

    function extended_editor_mce_buttons3($buttons) {
    return array(
    "tablecontrols");
    return $buttons;
    }
    ?>

    I think I got it right. According to the TinyMCE documeantion, the button for ispell has the same name as the plugin. I keep moving it around, saving the plugin, going to the write screen and doing a shift+refresh. I even cleared my cache just in case. Nothing. Do I need to do more than add it in the advanced_edit plugin? Do I have to edit tinymce.js too? And how do I do that without breakin it?

    I can't see what's wrong, any more than I can see why it has to be so hard. If anyone can, I'd appreciate the help. As it is I'll probably spend the whole day just trying to get this right.

  15. doc
    Member
    Posted 8 years ago #

    I just posted before seeing this thread... the problem with IEspell check is that you have to run Explorer.

    So going to the OP's topic for this thread, my addition to the TinyMCE wishlist is a TinyMCE/Firefox spell checker solution.

  16. brianbonner
    Member
    Posted 8 years ago #

    I am having the same problem. I am in the same place as terrance.

  17. brianbonner
    Member
    Posted 8 years ago #

    OK, I finally got it working for me with the following code:

    <?php
    /*
    Plugin Name: Advanced WYSIWYG Editor
    Plugin URI: http://www.labnotes.org/
    Description: Adds more styling options to the WYSIWYG post editor.
    Version: 0.2
    Author: Assaf Arkin
    Author URI: http://labnotes.org/
    License: Creative Commons Attribution-ShareAlike
    Tags: wordpress tinymce
    */

    if (isset($wp_version)) {
    add_filter("mce_plugins", "extended_editor_mce_plugins", 0);
    add_filter("mce_buttons", "extended_editor_mce_buttons", 0);
    add_filter("mce_buttons_2", "extended_editor_mce_buttons_2", 0);
    add_filter("mce_buttons_3", "extended_editor_mce_buttons_3", 0);
    }

    function extended_editor_mce_plugins($plugins) {
    array_push($plugins, "table", "fullscreen", "emotions", "advlink", "advimage", "searchreplace", "iespell");
    return $plugins;
    }

    function extended_editor_mce_buttons($buttons) {
    return array("cut", "copy", "paste", "separator", "undo", "redo", "separator", "search,replace", "separator", "iespell", "charmap", "emotions", "separator", "link", "unlink", "anchor", "image", "separator", "removeformat", "code", "fullscreen", "wordpress", "wphelp");
    }

    function extended_editor_mce_buttons_2($buttons) {
    return array(
    "formatselect", "bold", "italic", "underline", "strikethrough", "sub", "sup", "separator", "justifyleft", "justifycenter", "justifyright", "justifyfull", "separator", "bullist", "numlist", "outdent", "indent", "separator", "forecolor", "backcolor", "separator", "hr");
    return $buttons;
    }

    function extended_editor_mce_buttons_3($buttons) {
    // Add buttons on the third toolbar line
    return $buttons;
    }
    ?>

  18. TerranceDC
    Member
    Posted 8 years ago #

    This didn't work for me. I even emptied my cache and did a shift+refresh in the "Write" panel after copying and pasting the code above, and I still didn't see the iespell button. Maybe it's because I"m on Firefox <i>and</i> on a Mac.

    Anyway, I think the only answer is for me to deactivate the WYSIWYG. That's a shame, because I thought it was the most obviously beneficial feature in 2.0. Without it, I'm not entirely sure why I upgraded in the first place.

    I'm not sure what value WYSIWYG has without spellcheck. As a writer, I'd much rather just write than have to deal with code. I'd prefer not to even see it if I don't have to. It's not because I don't know how to code HTML. I've been working on the web for years, and know more than enough HTML code to do what I want. It's just that now I'd rather deal with content, and it's easier to write and edit when I don't have to constantly distinguise content from code.

    So, that's why I was looking forward to the WYSIWYG. It isn't broken, but it doesn't have the feature I most want in a WYSIWYG, and it cannot be added in any way that works on the platform, browser and system I use.

    Therefore, I shall go back to having to sort code from content, and trying to ignore my external spellcheck when it cites code as misspellings, I guess. As I do, I'll be wondering why I upgraded in the first place.

  19. bravecreatures
    Member
    Posted 8 years ago #

    Its always such a pleasure to read a post and find the answer to your problem. I needed to dick around a little, but this thread has given me the start of what I am looking for.

    I now have most of the extended set of WYSIWYG controls working in WP 2.0, but I am wondering how I can get the full set going. Looking in the examples of the TinyMCE download package, there is an advanced example that has everything under the sun.

    On top of which the spell checker in the extended set ISNT appearing, although it appears to be called in the code.

    Does anyone have any comments or suggestions for a writer who is a little slow on the coding front?

  20. bravecreatures
    Member
    Posted 8 years ago #

    Just as an addition to this. I have been able to get a few more of the plugins showing up with the following code. What DOESNT seem to work is what seems to be called, in the TinyMCE full example, as part of the advanced template. When I add some of those, the MCE tool bar disappears completely.

    My working code is as follows, although there are a few things (like iespell and insertdatetime) that are not showing at all.

    <?php
    /*
    Plugin Name: Advanced WYSIWYG Editor
    Plugin URI: http://www.labnotes.org/
    Description: Adds more styling options to the WYSIWYG post editor.
    Version: 0.2
    Author: Assaf Arkin
    Author URI: http://labnotes.org/
    License: Creative Commons Attribution-ShareAlike
    Tags: wordpress tinymce
    */

    if (isset($wp_version)) {
    add_filter("mce_plugins", "extended_editor_mce_plugins", 0);
    add_filter("mce_buttons", "extended_editor_mce_buttons", 0);
    add_filter("mce_buttons_2", "extended_editor_mce_buttons_2", 0);
    add_filter("mce_buttons_3", "extended_editor_mce_buttons_3", 0);
    }

    function extended_editor_mce_plugins($plugins) {
    array_push($plugins, "table", "fullscreen", "emotions", "advlink", "advimage", "advhr", "searchreplace", "iespell", "paste", "insertdatetime", "preview", "zoom", "flash");
    return $plugins;
    }

    function extended_editor_mce_buttons($buttons) {
    return array("cut", "copy", "paste", "pastetext", "pasteword", "separator", "undo", "redo", "separator", "search,replace", "separator", "iespell", "charmap", "emotions", "flash", "advhr", "insertdatetime", "separator", "link", "unlink", "anchor", "image", "separator", "removeformat", "code", "fullscreen", "wordpress", "wphelp", "preview", "zoom");
    }

    function extended_editor_mce_buttons_2($buttons) {
    return array(
    "formatselect", "bold", "italic", "underline", "strikethrough", "sub", "sup", "separator", "justifyleft", "justifycenter", "justifyright", "justifyfull", "separator", "bullist", "numlist", "outdent", "indent", "separator", "forecolor", "backcolor", "separator", "tablecontrols");
    return $buttons;
    }

    function extended_editor_mce_buttons_3($buttons) {
    // Add buttons on the third toolbar line
    return $buttons;
    }
    ?>

  21. dan13l
    Member
    Posted 8 years ago #

    Hi, I posted info on getting a spellchecker to work here: http://wordpress.org/support/topic/53870?replies=3#post-299009

  22. bravecreatures
    Member
    Posted 8 years ago #

    Thanks, thats got me a step closer. I have posted some more issues in the other thread.

  23. bravecreatures
    Member
    Posted 8 years ago #

    There seem to be a few plugins that when called, dont show up in the toolbar. An example was the spell checker. Another couple of examples insertdatetime and zoom.

    I also cant figure out what plugin drives the "clean up code" buton.

    I am not sure what is causing the problem, although given my recent experience with spellercheck, I suspect the problem is that there is something missing or configured wrong.

    Any suggestions from anyone would really be apprecaited.

  24. MacAddict
    Member
    Posted 8 years ago #

    nice to see the editor integrated into this version, but is there any hope for adding an "ipload image" button.... HTMLAREA3 had this, but is no longer being supported... I tried like hell to get it to work, but tinyMCE kept overrriding HTMLAREA3..... I used HTMLAREA3 with a zencart install for a client, and it works flawlessly.......

    My clients that I am using wordpress for arent saavy enough to figure out the upload utility with wordpress, let alone cutting and pasting the url of the image into their posts....

    thanks for any help.....

  25. chromecow
    Member
    Posted 8 years ago #

    Hi,

    I'm using WP 2.01, and I've got the tablecontrols showing up flawlessly, but after I hitthe insert button on the table popup, well....nothing. The popup window stays open, and no table code is inserted.

    So close...and yet so far. Anyone have an insight? Using FF 1.5, btw.

  26. blonkm
    Member
    Posted 8 years ago #

    chromecow, same problem here. Only I have the MS script debugger and I get an error message. If you use FF you can probably also see an error message in the javascript console.

    This seems to be the problem:tinyMCEPopup.restoreSelection();

    Maybe I can hack it. Will let you know.

  27. likoma
    Member
    Posted 8 years ago #

    I still can't get the tables to show up. I'm supposed to upload the "tables" folder from TinyMCE to this folder, right?

    wp-includes/js/tinymce/plugins/

    I can see the Tiny buttons (not the table buttons) and they work fine UNTIL I actually upload that folder, then it reverts to the quick tags.

    I'm only trying to the get the table functions to work because it seems to be a collection of buttons just like the "Paste Word" button (is a part of the Paste collection) and I really want the Paste Word button.

    I've tried all of the code above, pasted, uploaded, deleted, re-uploaded, ctrl+F5 refresh, activated/deactivated plugin, etc. but starting to see double ... Could it be:

    -- file permissions? (CHMOD)
    -- uploading in binary, ascii, auto?
    -- something else I'm missing?

    Thanks. Tired. Did get the "fontselect" button to work as a client wanted that, thank you.

    Best,

    - Bradley

  28. likoma
    Member
    Posted 8 years ago #

    Finally got the buttons I wanted working (Paste from Word and Paste as Plain Text). Turns out, there was a version issue with Tiny MCE and Eduo gave the link to download Tiny MCE version 2.0.2 that did the trick!

  29. greg314159265
    Member
    Posted 8 years ago #

    Update to Comment 2 by Bricolou:

    He meant to say open "tiny_mce_gzip.php" which is located at:
    ...\wp-includes\js\tinymce\tiny_mce_gzip.php

    Also line numbers in this file may vary by version of WordPress so just look for the lines that look like the ones he mentions.

    Also be sure to hit shift+refresh when you're done in order to see the changes.

  30. akc
    Member
    Posted 7 years ago #

    Re the request for "TinyMCE/Firefox spell checker solution": that could be useful for some people, but since Firefox 2 will come built-in with a spellchecker (a beta version of which I am using now and is marking "spellchecker" as misspelled), it's probably not essential.

Topic Closed

This topic has been closed to new replies.

About this Topic