Closed janniconl closed 8 years ago
You need to create your own theme (explained here https://github.com/Deesen/tinymce4-for-modx-evo ) and adding plugin spellchecker, so theme would look like
$this->set('plugins', 'spellchecker anchor visualblocks autolink autosave save advlist fullscreen paste modxlink media contextmenu table youtube image imagetools code textcolor', 'string');
$this->set('toolbar1', 'spellchecker bold italic underline strikethrough', 'string');
$this->set('toolbar2', 'alignleft aligncenter alignright | undo redo', 'string');
$this->set('menubar', 'tools', 'string' );
$this->set('browser_spellcheck', true, 'bool' );
// Also I tried
// $this->set('gecko_spellcheck', true, 'bool' );
// $this->set('spellchecker_rpc_url', 'spellchecker.php', 'string' );
Anyway I tried browser-spellcheck as well as the spellchecker.php-variant. But I get whether an "undefined-error" or "Current spellchecker isn't supported". I cannot get it working. So maybe the only real working solution right now is the paid one https://www.tinymce.com/docs/get-started/spell-checking/#tinymcespellcheckerproplugin .
http://stackoverflow.com/questions/18626276/tinymce-4-0-5-spell-check-not-working
Ok, too bad. Thx a lot for checking though! I am going to try if this one works: http://tinymcespellcheck.com/
I'll get back on this later today.
Update: I've added only the following rule to my theme:
$this->set('browser_spellcheck', true, 'bool' );
After this browser spellcheck (In my case spellchecker of Firefox) starts to work. Which is sufficient for me, for now! So still not using the plugin, but maybe the solution I mentioned in my previous post is working for someone who really wants to use the plugin-option.
Could be nice as a configuration option for the plug-in or add it to the default theme?
In case someone is using the contextmenu plugin (enabled by default) and is having trouble accessing the browser’s right-click contextual menu (to see the correct spelling suggestions) within TinyMce content, try holding CTRL while right clicking ;-)
http://www.activecampaign.com/blog/tinymce-editor-tip-access-browser-right-click-menu/
For me the setting browser_spellcheck does not work. Cannot imagine, but maybe it has conflicts when used on localhost? Or it must be activated first in Firefox?
I have it working on a remote installation (LAMP stack, DirectAdmin environment), with Firefox 46.0.1 / win 7, default settings (not activated manually as far as I know) in both the Content rte and in TV rte's (even with custom themes) aswell, using the configuration for the Content rte below as an example.
It is also working the same way in Chrome 50.0.2661.102 / win 7.
Same in IE 11.0.9.x..
<?php
/*
* All available config-params of TinyMCE4
* https://www.tinymce.com/docs/configure/
*
* Belows default configuration setup assures all editor-params have a fallback-value, and type per key is known
* $this->set( $editorParam, $value, $type, $emptyAllowed=false )
*
* $editorParam = param to set
* $value = value to set
* $type = string, number, bool, json (array or string)
* $emptyAllowed = true, false (allows param:'' instead of falling back to default)
* If $editorParam is empty and $emptyAllowed is true, $defaultValue will be ignored
*
* $this->modxParams holds an array of actual Modx- / user-settings
*
* */
$this->set('plugins', 'contextimage contextvideo autoresize advlist autolink lists link image charmap print preview hr anchor pagebreak searchreplace wordcount visualblocks visualchars code fullscreen spellchecker insertdatetime media nonbreaking save contextmenu directionality emoticons template paste textcolor codesample colorpicker textpattern imagetools paste modxlink youtube', 'string');
$this->set('toolbar1', 'undo redo | save newdocument | cut copy paste pastetext | searchreplace | bold italic underline strikethrough | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent blockquote | styleselect', 'string');
$this->set('toolbar2', 'link unlink anchor image | contextvideo contextimage codesample | hr removeformat | subscript superscript charmap | nonbreaking | visualchars visualblocks | print preview fullscreen | template code', 'string');
$this->set('toolbar3', NULL);
$this->set('toolbar4', NULL);
$this->set('browser_spellcheck', true, 'bool' );
// Hide bars
$this->set('menubar', false, 'bool' ); // https://www.tinymce.com/docs/configure/editor-appearance/#menubar
$this->set('statusbar', false, 'bool' ); // https://www.tinymce.com/docs/get-started/customize-ui/#hidingthestatusbar
// Templates
$this->set('templates', $this->pluginParams['base_url'].'theme/theme.templates.php');
// Custom Styles
$this->set('style_formats', '[
{title: "Kop 1", format: "h1"},
{title: "Kop 2", format: "h2"},
{title: "Kop 3", format: "h3"},
{title: "Kop 4", format: "h4"},
{title: "Kop 2 (Stijl 2)", block: "h2", classes: "heading-style2"},
{title: "Links uitlijnen", selector: "a,strong,em,p,h1,h2,h3,h4,h5,h6,ul,ol,table,span,figure", classes: "pull-left align-left"},
{title: "Rechts uitlijnen", selector: "a,strong,em,p,h1,h2,h3,h4,h5,h6,ul,ol,table,span,figure", classes: "pull-right align-right"}
]', 'json');
// https://www.tinymce.com/docs/plugins/paste/#paste_word_valid_elements
$this->set('paste_word_valid_elements', 'a[href|name],p,b,strong,i,em,h1,h2,h3,h4,h5,h6,br,hr,sub,sup,u,h1,h2,h3,h4,h5,h6', 'string');
$this->set('invalid_elements', 'table,th,td[colspan|rowspan],tr,thead,tfoot,tbody', 'string');
And it is required to install the right dictionary from https://addons.mozilla.org/de/firefox/language-tools/ , otherwise TinyMCE will return a warning "Spellchecker Service: (undefined)"
I see the plugin is there (in
assets/plugins/tinymce4/tinymce/plugins/spellchecker
), but I cant manage to make it work.Also see: https://www.tinymce.com/docs/plugins/spellchecker/
Will it support the language my manager user or global manager language has? Can I use this field for it?