We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 34162
    • 1 Posts
    Look at how Drupal site provide an instruction on how to download the latest TinyMCE and add it into Drupal to work as a plugin. It is just amazing to me. Oh, also the way Drupal install the module just drop in the file and the admin will detect it and user can decide to enable or disable it in the admin panel.

    **** install doc ***
    ********************************************************************
    D R U P A L M O D U L E
    ********************************************************************
    Name: TinyMCE module
    Authors: Matt Westgate <drupal at asitis dot org> and
    Richard Bennett <richard.b at gritechnologies dot com>
    Jeff Robbins <robbins at jjeff dot com>
    Dependancies:
    This module requires the third-party TinyMCE editor and a
    Javascript-enabled web browser. Currently it is known to work
    with Internet Explorer, Mozilla and Firefox and degrade gracefully
    for Safari and Konqueror users. A browser compatibility chart is here:

    http://tinymce.moxiecode.com/tinymce/docs/compatiblity_chart.html

    INSTALLATION:
    ********************************************************************
    1. Place the entire tinymce directory into your Drupal modules/
    directory.

    2. Download TinyMCE 2.0 from

    http://prdownloads.sourceforge.net/tinymce/tinymce_2_0RC1.zip?download

    Remember to uncompress the file and make sure the folder is named
    ’tinymce’.

    3. Place the entire ’tinymce’ engine folder inside your modules/tinymce
    directory.

    4. Load the database definition file (tinymce.mysql) using the
    tool of your choice (e.g. phpmyadmin). For mysql and command line
    access use:

    mysql -u user -p drupal < tinymce.mysql

    Replace ’user’ with the MySQL username, and ’drupal’ with the
    database being used.

    4. Enable this module by navigating to:

    administer > modules

    5. Setup role based tinymce profiles via

    administer > settings > tinymce

    6. Optionally download the "TinyMCE compressor" from

    http://tinymce.moxiecode.com/download.php

    And follow the instructions that come with that package.

    Create new content as a role that has TinyMCE permissions and see TinyMCE in
    action!

    README:
    ********************************************************************
    Once TinyMCE is enabled, the default behavior is that all textareas
    will use TinyMCE for all users. The admin can change these defaults
    at

    administer > settings > tinymce

    The admin can choose what theme TinyMCE should be the default and
    user’s can override this by editing their account (if they’ve been
    given permissions to do so). User’s also have the option of disabling
    TinyMCE completely.

    The admin can also define which pages TinyMCE should be used on.
    This cannot be changed on a per user basis.

    DRUPAL PLUGINS FOR TINYMCE:
    ********************************************************************
    NOTE: If you want to use img_assist with TinyMCE, you don’t have to
    install a plugin. Just enable the img_assist module and click
    the photo icon that appears below each textarea.

    Located in the plugins directory are Drupal specific plugins for
    TinyMCE. Once you’ve downloaded and installed the TinyMCE engine,
    copy this plugins over the directory of TinyMCE
    (tinymce/jscripts/tiny_mce/). Most of these plugins will already be
    active if you use the ’advanced’ theme for tinymce. See the
    documentation in each plugin folder for more details.

    CAVEATS
    ********************************************************************
    By default, Drupal uses the ’Filtered HTML’ input format for adding
    content to the site and this can create conflicts with TinyMCE. It’s
    best when using this editor to use an input format that has all
    filters disabled. What I usually do is create an input format called
    ’Rich-text editing’ and set that as the default format for roles which
    use TinyMCE exclusively. To modify your input formats go to:

    Administer > input formats > configure > configure filters

    TWEAKING THE TINYMCE THEME
    ********************************************************************

    Developers have complete control over when and how tinymce is enabled
    for each textarea inside Drupal by creating a custom Drupal theme
    function. The following example assumes you’re using a phptemplate based theme.

    Put the following function in your themes template.php file:

    /**
    * Customize a TinyMCE theme.
    *
    * @param init
    * An array of settings TinyMCE should invoke a theme. You may override any
    * of the TinyMCE settings. Details here:
    *
    * http://tinymce.moxiecode.com/wrapper.php?url=tinymce/docs/using.htm
    *
    * @param textarea_name
    * The name of the textarea TinyMCE wants to enable.
    *
    * @param theme_name
    * The default tinymce theme name to be enabled for this textarea. The
    * sitewide default is ’simple’, but the user may also override this.
    *
    * @param is_running
    * A boolean flag that identifies id TinyMCE is currently running for this
    * request life cycle. It can be ignored.
    */
    function phptemplate_tinymce_theme($init, $textarea_name, $theme_name, $is_running) {
    switch ($textarea_name) {
    // Disable tinymce for these textareas
    case ’log’:
    case ’img_assist_pages’:
    case ’caption’:
    unset($init);
    break;

    // Force the ’simple’ theme for some of the smaller textareas.
    case ’signature’:
    case ’site_mission’:
    case ’site_footer’:
    case ’settings][access_pages’:
    $init[’theme’] = ’simple’;
    unset($init[’theme_advanced_toolbar_location’]);
    unset($init[’theme_advanced_toolbar_align’]);
    unset($init[’theme_advanced_path_location’]);
    unset($init[’theme_advanced_blockformats’]);
    unset($init[’theme_advanced_styles’]);
    break;
    }

    // Add some extra features when using the advanced theme.
    switch ($theme_name) {
    case ’advanced’:
    $init[’extended_valid_elements’] = array(’a[href|target|name|title|onclick]’);
    $init[’theme_advanced_buttons3_add_before’] = array(’tablecontrols’);
    break;
    }

    // Always return $init; !!
    return $init;
    }

    If you study the above function you can see that tinymce can be completely
    disabled or you can even switch themes for a given textarea.

    See the TinyMCE manual for details on the parameters that can be
    sent to TinyMCE:

    http://tinymce.moxiecode.com/documentation.php

    TINYMCE KEYBOARD SHORTCUTS
    ********************************************************************
    Ctrl+Z Undo
    Ctrl+Y Redo
    Ctrl+B Bold
    Ctrl+I Italic
    Ctrl+U Underline
    **** install doc ***
      • 4018
      • 1,131 Posts
      Man...that sure does seem like a lot to do just to install a plugin/module! One thing I noticed though is that it doesn’t appear that Drupal uses any sort of resource browser or the like. Hmm...
        Jeff Whitfield

        "I like my coffee hot and strong, like I like my women, hot and strong... with a spoon in them."
        • 34162
        • 1 Posts
        Jeff,

        The verbose seems like a lot but the actual steps are:
        . unzip the TinyMCE to the folder
        . unzip the module into the module folder
        . In admin panel enable the module

        That’s it!

        PS: The point of this post is anyone can download the latest distribution from the project site and put it in the folder and it is ugpraded. I did it last night from TinyMcE 1.44 to the latest version RC2 and I don’t have to reloade the Drupal module even.
          • 4018
          • 1,131 Posts
          Well...the goal in the end would be to have a plugin/module system that accepted zip files (similar to Mambo). I really would like to have the RTE’s setup in such a way to where a user can simply drop the latest version in and it works. But at the moment, until I figure out how to improve the current resource browser to where it doesn’t require javascript functions to be present in the editors themselves, we’re stuck with the current system! Not to worry...we’ll get there soon enough! smiley
            Jeff Whitfield

            "I like my coffee hot and strong, like I like my women, hot and strong... with a spoon in them."
            • 10525
            • 247 Posts
            It may look different to the way it's done in modx, but I envy the level of explanation and detail. I cannot even find any basic directions on how to configure all the tinymce and rich text editor settings in modx.

            Can anyone suggest where I can find them?
              • 42562
              • 1,145 Posts
              I am working on a better (in my opinion) TinyMCE plugin
                TinymceWrapper: Complete back/frontend content solution.
                Harden your MODX site by passwording your three main folders: core, manager, connectors and renaming your assets (thank me later!)
                5 ways to sniff / hack your own sites; even with renamed/hidden folders, burst them all up, to see how secure you are not.
                • 3749
                • 24,544 Posts
                Quote from: donshakespeare at Jun 16, 2015, 10:55 PM
                I am working on a better (in my opinion) TinyMCE plugin

                An excellent idea. smiley

                BTW, it would make my life a whole lot easier if it, and the file/image browser, worked in the front end (for NewsPublisher).

                I don't think there's any reason that Tiny needs to be tied to the Manager, but earlier versions seem to be.

                At one point, I experimented with the CDN version of TinyMCe: http://www.tinymce.com/wiki.php/Tutorial:Using_CDN. I did get it working with NewsPublisher, but wasn't sure if everyone would want it.
                  Did I help you? Buy me a beer
                  Get my Book: MODX:The Official Guide
                  MODX info for everyone: http://bobsguides.com/modx.html
                  My MODX Extras
                  Bob's Guides is now hosted at A2 MODX Hosting
                  • 25803 ☆ A M B ☆
                  • 721 Posts
                  Quote from: donshakespeare at Jun 16, 2015, 10:55 PM
                  I am working on a better (in my opinion) TinyMCE plugin

                  So there are 2 TinyMCE packages currently:

                  http://modx.com/extras/package/tinymce
                  http://modx.com/extras/package/tinymcerichtexteditor

                  And presumably a third down the way.
                  How would the third differ from the other 2?
                    • 42562
                    • 1,145 Posts
                    Currently I have a plugin that allows me to choose any major RTE or CodeTE.
                    @rx2
                    It differs like so:
                    1. It pulls its RTE settings from RTE specific chunks.
                    2. So any whoever can go, to say, the TinyMCE chunk and edit ALL of TinyMCE's settings, simple, done, voila!
                    The existing extras make it almost impossible to find the blasted settings, and these settings are mere JavaScript, and in my opinion should not, never be obfuscated; I mean, TinyMCE is so easy to setup, why should it be complicated? Why should TinyMCE-specific questions be asked in a MODx forum? E.g. TinyMCE is eating my code, how do I stop it? TinyMCE adds line breaks unnecessarily, how do I stop that?
                    Yet basic questions on TinyMCE are so rampant here, because the simple <script>tinymce.init(...);</script> can't be found. And yes, the settings in the MODx settings page is highly limiting.
                    3. Because I don't understand the MODx file browser, I incorporated a custom file browser, in fact, because the TinyMCE settings are exposed in a readable chunk, the user can, with a few lines of code use any available open source file browser.
                    4. Greater flexibility as to what textarea you wish to revamp; the Description/into, RTE-enabled TVs and Content textareas can have varied TinyMCE setups. I don't have any clue how the MIGX Tvs work, so someone else will have to figure that.
                    5. TinyMCE will always be up to date, and be the current version found on tinymce.com; don't have to beg your phone carrier to update your device's Android OS.

                    I am not a master of MODx, so I was hoping someone would run with the idea, but while waiting, I decided to cook up a plugin I will share with you in the hopes that you, my masters, will clean it up real good.

                    @BobRay this plugin does not use the native MODx file manager, because I don't understand an iota of how the bridge works.
                    But if the person who wrote the MODx file manager plugin for the current MODX TinyMCE extra could join this conversation, what a joy it would be. That bridge is spectacular in its own right!

                    Tinymce.com describes a tutorial http://www.tinymce.com/wiki.php/TinyMCE3x:How-to_implement_a_custom_file_browser
                    My questions to the person are (on behalf of those who wish to continue to use the MODx file browser on the frontend):

                    a. Can the tinymce tutorial be applied in MODx? Please show us how!
                    b. In order to access the MODx file browser at all, does one require MODx Manager credentials?
                      TinymceWrapper: Complete back/frontend content solution.
                      Harden your MODX site by passwording your three main folders: core, manager, connectors and renaming your assets (thank me later!)
                      5 ways to sniff / hack your own sites; even with renamed/hidden folders, burst them all up, to see how secure you are not.
                      • 3749
                      • 24,544 Posts
                      That all sounds great (and long overdue). I sometimes wonder if *anyone* understands the MODX file browser. I certainly don't. It does require a Manager login.

                      NewsPublisher has a special permission for this and users very limited access to the Manager context, though they remain in the front end. A user who is logged in to use NewsPublisher can actually access Manager pages (with *very* limited capabilities) if they know the page IDs, but they would have to know the name of the Manager folder, so it's quite safe as long as you rename the Manager folder (as everyone should).

                      Marcus Schlegel was kind enough to do the NewsPublisher file browser for me. TBH, I'm not sure how it works.
                        Did I help you? Buy me a beer
                        Get my Book: MODX:The Official Guide
                        MODX info for everyone: http://bobsguides.com/modx.html
                        My MODX Extras
                        Bob's Guides is now hosted at A2 MODX Hosting