Initiate and show tinyMCE wordcount plugin in Moodle 2.3.4

Initiate and show tinyMCE wordcount plugin in Moodle 2.3.4

by Stephen Overall -
Number of replies: 2

I would like to initiate and show the TinyMCE wordcount plugin in the Moodle 2.3.4+ HTML editor, for example, showing the activated button in the HTML editor's third row at the end just to the right of the spell checker button. I can see that the wordcount plugin is included in the Moodle 2.3.4+ tinyMCE code.

Could anyone please walk me through how exactly to do this? TIA.

========

P.S. I just found this post which seems to address my question...

 
I'll try that solution first and see if it works.
 
 
Average of ratings: -
In reply to Stephen Overall

Re: Initiate and show tinyMCE wordcount plugin in Moodle 2.3.4

by Stephen Overall -

To answer my own question, activating the TinyMCE wordcount plugin in the Moodle 2.3.4 HTML editor is simple.

  1. Open yourmoodle/lib/editor/tinymce/lib.php
  2. Find at line 84 the protected function get_init_params() which contains the $params array at line 126 which in turn contains the plugins array at line 142.
  3. In the plugins array, after spellchecker add ,wordcount
  4. Save file. Reload. Textarea word count shows in TinyMCE status bar. No menu button needed. Nice.

Moodle 2.4 features a full TinyMCE configuration admin page here >> http://docs.moodle.org/24/en/Text_editor#TinyMCE_editor_settings 

 
 
 
In reply to Stephen Overall

Re: Initiate and show tinyMCE wordcount plugin in Moodle 2.3.4

by Stephen Overall -

Note: this fix also works in Moodle 2.4.5+ by just adding wordcount into the $params array as described above. Code looks different but is the same structure and yields the same result.

I tried adding wordcount into the Moodle 2.4.5+ Site admin > Plugins > Text editors > TinyMC HTML editor > General settings page Editor toolbar textbox with no effect. Adding wordcount directly into lib.php does work.