You are here

INSTALL.txt in TinyMCE 5.2

Same filename and directory in other branches
  1. 5 INSTALL.txt
  2. 6.2 INSTALL.txt
  3. 6 INSTALL.txt
********************************************************************
                     D R U P A L    M O D U L E
********************************************************************
Name: TinyMCE module

Maintainers:  Theodore Serbinski <stanson AT gmail DOT com> and
              Matt Westgate <drupal AT asitis DOT org> and
              Jeff Robbins <robbins AT jjeff DOT com>
              Richard Bennett <richard.b AT gritechnologies DOT com>
              Jonathan <suport@drupal 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:
********************************************************************

NOTE: During this installation process you'll be asked to also 
      install the official TinyMCE package from 
      tinymce.moxiecode.com.


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

   
2. Download TinyMCE 2.0 from

     http://tinymce.moxiecode.com/

   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. So the TinyMCE engine will live in modules/tinymce/tinymce

   
4. Enable this module by navigating to:

     administer > modules
     
     *note - all database tables will be automatically created during this step

     
5. Setup role based tinymce profiles via

     administer > settings > tinymce

     
6. To boost the performance of TinyMCE, download the "TinyMCE compressor" from:

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

   Place the tiny_mce_gzip.php file in 
   
     modules/tinymce/tinymce/jscripts/tiny_mce

      
7. To use AJAX spell checking, download the spellchecker plugin:
   (note: this requires TinyMCE 2.0.6+)
   
     http://tinymce.moxiecode.com/download.php
   
   Extract this file to
     
     modules/tinymce/tinymce/jscripts/tiny_mce/plugins/
   
   Then edit config.php in plugins/spellchecker/:
   
     Uncomment this line and comment out all other require_once's:
   
       require_once("classes/TinyGoogleSpell.class.php"); // Google web service
   
     Set this to true:	
	 
	     $spellCheckerConfig['enabled'] = true;
	  
	 Enable spellchecker in TinyMCE settings page, under "buttons and plugins"


   
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.


PLUGINS FOR TINYMCE:
********************************************************************
Adding plugins to TinyMCE is very easy. By default, all TinyMCE
plugins are disabled, but can easily be enabled by going to:
   
   Administer > settings > tinymce
   
And then editing a profile (make sure you create one first!) and going
to the Buttons & Plugins section. To enable a button or a plugin,
simply check a box and TinyMCE will automatically be updated. To find
out more info on what a specific button or plugin does, click the 
corresponding link (note not all buttons have help text).

If you wish to add more plugins to TinyMCE, simply extract these
plugins to the folder: tinymce\jscripts\tiny_mce\plugins

Then open up plugin_reg.php, found in the TinyMCE module folder.

Add the following lines:

  $plugins['plugin_name'] = array();
  $plugins['plugin_name']['theme_advanced_buttons3'] = array('icon_name');
     // note, you can choose which row of buttons to use by changing
     // the 3 to either 1 or 2
  $plugins['plugin_name']['plugin_property'] = array('property_value');
  
Be sure to set the 'plugin_name' to the name of the plugin (generally
the plugin folder name) and set the 'icon_name' and other properties
(properties are optional). See plugin_reg.php for more examples.

To add Drupal specific plugins, TinyMCE comes bundled with plugins
in the main module directory. These plugins include:

  - drupalimage: works in conjunction with the img_assist Drupal
    module
    
    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.

Follow the directions in the README.txt for these plugins to enable them.


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 theme_tinymce_theme($init, $textarea_name, $theme_name, $is_running) {
  switch ($textarea_name) {
    // Disable tinymce for these textareas
    case 'log': // book and page log
    case 'img_assist_pages':
    case 'caption': // signature
    case 'pages':
    case 'access_pages': //TinyMCE profile settings.
    case 'user_mail_welcome_body': // user config settings
    case 'user_mail_approval_body': // user config settings
    case 'user_mail_pass_body': // user config settings
    case 'synonyms': // taxonomy terms
    case 'description': // taxonomy terms
      unset($init);
      break;

    // Force the 'simple' theme for some of the smaller textareas.
    case 'signature':
    case 'site_mission':
    case 'site_footer':
    case 'site_offline_message':
    case 'page_help':
    case 'user_registration_help':
    case 'user_picture_guidelines':
      $init['theme'] = 'simple';
      foreach ($init as $k => $v) {
        if (strstr($k, 'theme_advanced_')) unset($init[$k]);
      }
      break;
  }

  /* Example, add some extra features when using the advanced theme.
  
  // If $init is available, we can extend it
  if (isset($init)) {
    switch ($theme_name) {
     case 'advanced':
       $init['extended_valid_elements'] = array('a[href|target|name|title|onclick]');
       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

File

INSTALL.txt
View source
  1. ********************************************************************
  2. D R U P A L M O D U L E
  3. ********************************************************************
  4. Name: TinyMCE module
  5. Maintainers: Theodore Serbinski and
  6. Matt Westgate and
  7. Jeff Robbins
  8. Richard Bennett
  9. Jonathan
  10. Dependancies:
  11. This module requires the third-party TinyMCE editor and a
  12. Javascript-enabled web browser. Currently it is known to work
  13. with Internet Explorer, Mozilla and Firefox and degrade gracefully
  14. for Safari and Konqueror users. A browser compatibility chart is here:
  15. http://tinymce.moxiecode.com/tinymce/docs/compatiblity_chart.html
  16. INSTALLATION:
  17. ********************************************************************
  18. NOTE: During this installation process you'll be asked to also
  19. install the official TinyMCE package from
  20. tinymce.moxiecode.com.
  21. 1. Place the entire tinymce directory into your Drupal modules/
  22. directory.
  23. 2. Download TinyMCE 2.0 from
  24. http://tinymce.moxiecode.com/
  25. Remember to uncompress the file and make sure the folder is named
  26. 'tinymce'.
  27. 3. Place the entire 'tinymce' engine folder inside your modules/tinymce
  28. directory. So the TinyMCE engine will live in modules/tinymce/tinymce
  29. 4. Enable this module by navigating to:
  30. administer > modules
  31. *note - all database tables will be automatically created during this step
  32. 5. Setup role based tinymce profiles via
  33. administer > settings > tinymce
  34. 6. To boost the performance of TinyMCE, download the "TinyMCE compressor" from:
  35. http://tinymce.moxiecode.com/download.php
  36. Place the tiny_mce_gzip.php file in
  37. modules/tinymce/tinymce/jscripts/tiny_mce
  38. 7. To use AJAX spell checking, download the spellchecker plugin:
  39. (note: this requires TinyMCE 2.0.6+)
  40. http://tinymce.moxiecode.com/download.php
  41. Extract this file to
  42. modules/tinymce/tinymce/jscripts/tiny_mce/plugins/
  43. Then edit config.php in plugins/spellchecker/:
  44. Uncomment this line and comment out all other require_once's:
  45. require_once("classes/TinyGoogleSpell.class.php"); // Google web service
  46. Set this to true:
  47. $spellCheckerConfig['enabled'] = true;
  48. Enable spellchecker in TinyMCE settings page, under "buttons and plugins"
  49. Create new content as a role that has TinyMCE permissions and see TinyMCE in
  50. action!
  51. README:
  52. ********************************************************************
  53. Once TinyMCE is enabled, the default behavior is that all textareas
  54. will use TinyMCE for all users. The admin can change these defaults
  55. at
  56. administer > settings > tinymce
  57. The admin can choose what theme TinyMCE should be the default and
  58. user's can override this by editing their account (if they've been
  59. given permissions to do so). User's also have the option of disabling
  60. TinyMCE completely.
  61. The admin can also define which pages TinyMCE should be used on.
  62. This cannot be changed on a per user basis.
  63. PLUGINS FOR TINYMCE:
  64. ********************************************************************
  65. Adding plugins to TinyMCE is very easy. By default, all TinyMCE
  66. plugins are disabled, but can easily be enabled by going to:
  67. Administer > settings > tinymce
  68. And then editing a profile (make sure you create one first!) and going
  69. to the Buttons & Plugins section. To enable a button or a plugin,
  70. simply check a box and TinyMCE will automatically be updated. To find
  71. out more info on what a specific button or plugin does, click the
  72. corresponding link (note not all buttons have help text).
  73. If you wish to add more plugins to TinyMCE, simply extract these
  74. plugins to the folder: tinymce\jscripts\tiny_mce\plugins
  75. Then open up plugin_reg.php, found in the TinyMCE module folder.
  76. Add the following lines:
  77. $plugins['plugin_name'] = array();
  78. $plugins['plugin_name']['theme_advanced_buttons3'] = array('icon_name');
  79. // note, you can choose which row of buttons to use by changing
  80. // the 3 to either 1 or 2
  81. $plugins['plugin_name']['plugin_property'] = array('property_value');
  82. Be sure to set the 'plugin_name' to the name of the plugin (generally
  83. the plugin folder name) and set the 'icon_name' and other properties
  84. (properties are optional). See plugin_reg.php for more examples.
  85. To add Drupal specific plugins, TinyMCE comes bundled with plugins
  86. in the main module directory. These plugins include:
  87. - drupalimage: works in conjunction with the img_assist Drupal
  88. module
  89. NOTE: If you want to use img_assist with TinyMCE, you don't have to
  90. install a plugin. Just enable the img_assist module and click
  91. the photo icon that appears below each textarea.
  92. Follow the directions in the README.txt for these plugins to enable them.
  93. CAVEATS
  94. ********************************************************************
  95. By default, Drupal uses the 'Filtered HTML' input format for adding
  96. content to the site and this can create conflicts with TinyMCE. It's
  97. best when using this editor to use an input format that has all
  98. filters disabled. What I usually do is create an input format called
  99. 'Rich-text editing' and set that as the default format for roles which
  100. use TinyMCE exclusively. To modify your input formats go to:
  101. Administer > input formats > configure > configure filters
  102. TWEAKING THE TINYMCE THEME
  103. ********************************************************************
  104. Developers have complete control over when and how tinymce is enabled
  105. for each textarea inside Drupal by creating a custom Drupal theme
  106. function. The following example assumes you're using a phptemplate based theme.
  107. Put the following function in your themes template.php file:
  108. /**
  109. * Customize a TinyMCE theme.
  110. *
  111. * @param init
  112. * An array of settings TinyMCE should invoke a theme. You may override any
  113. * of the TinyMCE settings. Details here:
  114. *
  115. * http://tinymce.moxiecode.com/wrapper.php?url=tinymce/docs/using.htm
  116. *
  117. * @param textarea_name
  118. * The name of the textarea TinyMCE wants to enable.
  119. *
  120. * @param theme_name
  121. * The default tinymce theme name to be enabled for this textarea. The
  122. * sitewide default is 'simple', but the user may also override this.
  123. *
  124. * @param is_running
  125. * A boolean flag that identifies id TinyMCE is currently running for this
  126. * request life cycle. It can be ignored.
  127. */
  128. function theme_tinymce_theme($init, $textarea_name, $theme_name, $is_running) {
  129. switch ($textarea_name) {
  130. // Disable tinymce for these textareas
  131. case 'log': // book and page log
  132. case 'img_assist_pages':
  133. case 'caption': // signature
  134. case 'pages':
  135. case 'access_pages': //TinyMCE profile settings.
  136. case 'user_mail_welcome_body': // user config settings
  137. case 'user_mail_approval_body': // user config settings
  138. case 'user_mail_pass_body': // user config settings
  139. case 'synonyms': // taxonomy terms
  140. case 'description': // taxonomy terms
  141. unset($init);
  142. break;
  143. // Force the 'simple' theme for some of the smaller textareas.
  144. case 'signature':
  145. case 'site_mission':
  146. case 'site_footer':
  147. case 'site_offline_message':
  148. case 'page_help':
  149. case 'user_registration_help':
  150. case 'user_picture_guidelines':
  151. $init['theme'] = 'simple';
  152. foreach ($init as $k => $v) {
  153. if (strstr($k, 'theme_advanced_')) unset($init[$k]);
  154. }
  155. break;
  156. }
  157. /* Example, add some extra features when using the advanced theme.
  158. // If $init is available, we can extend it
  159. if (isset($init)) {
  160. switch ($theme_name) {
  161. case 'advanced':
  162. $init['extended_valid_elements'] = array('a[href|target|name|title|onclick]');
  163. break;
  164. }
  165. }
  166. */
  167. // Always return $init
  168. return $init;
  169. }
  170. If you study the above function you can see that tinymce can be completely
  171. disabled or you can even switch themes for a given textarea.
  172. See the TinyMCE manual for details on the parameters that can be
  173. sent to TinyMCE:
  174. http://tinymce.moxiecode.com/documentation.php
  175. TINYMCE KEYBOARD SHORTCUTS
  176. ********************************************************************
  177. Ctrl+Z Undo
  178. Ctrl+Y Redo
  179. Ctrl+B Bold
  180. Ctrl+I Italic
  181. Ctrl+U Underline