2017 © Pedro Peláez
 

silverstripe-vendormodule ss-tinymce-charcount

Plugin for tinyMCE in siverstripe to count characters

image

drmartingonzo/ss-tinymce-charcount

Plugin for tinyMCE in siverstripe to count characters

  • Wednesday, April 11, 2018
  • by DrMartinGonzo
  • Repository
  • 1 Watchers
  • 0 Stars
  • 11 Installations
  • JavaScript
  • 1 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 2 Versions
  • 57 % Grown

The README.md

Silverstripe 4 TinyMCE characters count

Screenshot of TinyMCE plugin, (*1)

Installation

composer require drmartingonzo/ss-tinymce-charcount ^1.1.0, (*2)

Requirements

  • SilverStripe CMS ^4.0

Enable plugin

In your _config.php file, add :, (*3)

use SilverStripe\Forms\HTMLEditor\HtmlEditorConfig;
use SilverStripe\Core\Manifest\ModuleResourceLoader;

Then add whatever plugins you wish to enable, + charcount, (*4)

HtmlEditorConfig::get('cms')
->enablePlugins([
    'template',
    'fullscreen',
    'hr',
    'contextmenu',
    'charmap',
    'visualblocks',
    'lists',
    'charcount' => ModuleResourceLoader::resourceURL('drmartingonzo/ss-tinymce-charcount:client/dist/js/bundle.js'),
])

Finally run dev/build with flush to remove previous TinyMCE javascript cache., (*5)

Adding a max character attribute to a TinyMCE instance

Set data-maxchar on HTMLEditorField. Example :, (*6)

HTMLEditorField::create(
    "Content",
    'Content'
)->setAttribute('data-maxchar', 526),

Adding a max word attribute to a TinyMCE instance

Set data-maxword on HTMLEditorField. Example :, (*7)

HTMLEditorField::create(
    "Content",
    'Content'
)->setAttribute('data-maxword', 120),

The Versions

11/04 2018

dev-master

9999999-dev

Plugin for tinyMCE in siverstripe to count characters

  Sources   Download

BSD-3-Clause

The Requires

 

by Martin Portevin

tinymce silverstripe characters

11/04 2018

1.0.0

1.0.0.0

Plugin for tinyMCE in siverstripe to count characters

  Sources   Download

BSD-3-Clause

The Requires

 

by Martin Portevin

tinymce silverstripe characters