WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] WP 2 WYSIWYG H1/H2/H3 support? (15 posts)

  1. crunch42
    Member
    Posted 8 years ago #

    Can anyone post a step-by-step to enable the WYSIWYG editor (TinyMCE) that comes built-in with WP 2 to have a drop-down selector to allow you to format selected text as either h1, h2, h3, p, or none?

    It'd be great to not have to edit the HTML source to get this.

    Thanks,
    Julian

  2. andreacimatti
    Member
    Posted 8 years ago #

    Yes, this would be much appreciated

  3. nmallory
    Member
    Posted 8 years ago #

    I have to admit this would be a nice plugin.

  4. crunch42
    Member
    Posted 8 years ago #

    Here's how to do it for a default WP 2 installation:

    1. Open the file wp-includes/js/tinymce/tiny_mce_gzip.php
    2. Go to line number 127, or perform a search for
      $mce_buttons = apply_filters('mce_buttons'
    3. At the end of this line you'll see 'wphelp')); and you should replace this with 'wphelp', 'formatselect'));
    4. Re-upload this file.

    Note that you can put that 'formatselect' anywhere in that line 127 of code that you want -- I just put it at the end because that's where I want it. Et voila, a dropdown selector will now appear in the WYSIWYG editor that lets you choose , <h1>, <h2>, etc. tags, along with some wierd tags like <address> and <pre>.

  5. crunch42
    Member
    Posted 8 years ago #

    In fact, here's a list of other buttons/selectors that can probably be added to customize the default WP 2 RTE WYSIWYG TinyMCE Editor using the same instructions above (a lot of these are already enabled):

    bold, italic, underline, strikethrough, justifyleft, justifycenter, justifyright, justifyfull, bullist, numlist, outdent, indent, cut, copy, paste, undo, redo, link, unlink, image, cleanup, help, code, hr, removeformat,, formatselect, fontselect, fontsizeselect, styleselect, sub, sup, forecolor, backcolor, charmap, visualaid, anchor, newdocument, separator

    For more information on what each of these does, I'd download the full TinyMCE package from their website and look in the HTML docs that come with it, or maybe just troll the TinyMCE forums. I bet that at least some of these buttons won't work "out of the box" with WP, or have some other issues.

  6. nmallory
    Member
    Posted 8 years ago #

    Well, nifty!

  7. nmallory
    Member
    Posted 8 years ago #

    Oh, thanks!

  8. 3stripe
    Member
    Posted 8 years ago #

    Nice hint. Been struggling with this for ages. Now, what if I want to add my own tags to the dropdown?

  9. Robert
    Member
    Posted 8 years ago #

    But buttons for endusers?
    There'a plugin at sourceforge, but I'm not able to get it working.

  10. dbasulto
    Member
    Posted 7 years ago #

    I did this on /wp-includes/js/tinymce/tiny_mce_gzip.php
    i added the buttons on line 127, but it still doesn't show the new button.

    any idea why? i don't know what to debug here... since it's working fine

  11. josezald
    Member
    Posted 7 years ago #

    I have read most of the threads on this topic. However, I am still strugling with adding the full TinyMCE to WP2.08. Some icons download and others don't. I would like to see it the same way it shows in the full examples.

    Has someone done it?


    $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'));
    $mce_buttons = implode($mce_buttons, ',');
    $mce_buttons_2 = apply_filters('mce_buttons_2', array('cut,copy,paste,pastetext,pasteword,separator,search,replace,separator'));
    $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; ?>",
    theme_advanced_toolbar_location : "top",
    theme_advanced_toolbar_align : "left",
    theme_advanced_path_location : "bottom",
    theme_advanced_resizing : true,
    browsers : "<?php echo $mce_browsers; ?>",
    dialog_type : "modal",
    theme_advanced_resize_horizontal : false,

  12. nolageek
    Member
    Posted 7 years ago #

    I cant get the new buttons to work under 2.0.5... am I missing something? I uploaded the buttons and am using the Advanced WYSIWYG Editor plugin.

  13. horizens
    Member
    Posted 7 years ago #

    I'm having the same problem with getting the dropdown menu to show in 2.05. Any thoughts?

  14. jdm4727
    Member
    Posted 7 years ago #

    Try giving your ol' browser a refresh so it reloads the tiny_mce_gzip.php file. It didn't appear at first for me after following crunch42's instructions, but when I refreshed it showed up immediately.

  15. peiqinglong
    Member
    Posted 7 years ago #

    http://wordpress.org/support/topic/98416?replies=2

    I'm using this and works great!

Topic Closed

This topic has been closed to new replies.

About this Topic