PHPackages                             milkyway/silverstripe-htmleditorfield-extras - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. milkyway/silverstripe-htmleditorfield-extras

Abandoned → [milkyway-multimedia/ss-mwm-formfields](/?search=milkyway-multimedia%2Fss-mwm-formfields)Silverstripe-module

milkyway/silverstripe-htmleditorfield-extras
============================================

Add some extra functionality to HTMLEditorFields in Silverstripe

45081[4 issues](https://github.com/mi3ll/htmleditorfield-extras/issues)[3 PRs](https://github.com/mi3ll/htmleditorfield-extras/pulls)JavaScript

Since Dec 4Pushed 10y ago1 watchersCompare

[ Source](https://github.com/mi3ll/htmleditorfield-extras)[ Packagist](https://packagist.org/packages/milkyway/silverstripe-htmleditorfield-extras)[ RSS](/packages/milkyway-silverstripe-htmleditorfield-extras/feed)WikiDiscussions master Synced 5d ago

READMEChangelogDependenciesVersions (1)Used By (0)

HTMLEditorField extras
======================

[](#htmleditorfield-extras)

This module adds some new functionality to the HTMLEditorFields in Silverstripe

Requirements
------------

[](#requirements)

- SilverStripe 3.1

Features
--------

[](#features)

- Add Google link tracking to a link in the CMS
- Add modal toggling to a link in the CMS (still in progress, relies on Twitter Bootstrap)
- Allows accepting classes from Textarea to be inserted into HTMLEditorField body
- Set different content css for each HTMLEditorField
- Set a max length on HTMLEditorField

Install using composer
----------------------

[](#install-using-composer)

```
composer require milkyway/silverstripe-htmleditorfield-extras:*

```

Setting up
----------

[](#setting-up)

### Adding classes to the HTMLEditorField iframe

[](#adding-classes-to-the-htmleditorfield-iframe)

Setting up your HTMLEditorField for different parts of your site (such as emails and website, which usually use different stylesheets), can be tiring. This solution will add a class to the HTMLEditorField iframe body, so that you can change the styles but use the one stylesheet (this is especially easy to do with LESS/SCSS using imports)

```
$editor = HTMLEditorField::create('Content')->setAttribute('data-tinymce-classes', 'email-body print');

```

### Overwriting the content css for a HTMLEditorField

[](#overwriting-the-content-css-for-a-htmleditorfield)

If the above method is not enough, you can also overwrite the content\_css of the HTMLEditorField by setting the data attribute data-tinymce-content-css:

```
$editor = HTMLEditorField::create('Content')->setAttribute('data-tinymce-content-css', '/here/there/layout.css');

```

### Setting a max length to a HTMLEditorField

[](#setting-a-max-length-to-a-htmleditorfield)

Now your HTMLEditorField will use the max length set on the textarea:

```
$editor = HTMLEditorField::create('Content')->setAttribute('maxlength', 255);

```

I have added some other configuration as well, so that you can display how many characters remain. To add an indicator, set the following on your editor:

```
$editor->setAttribute('data-tinymce-maxlength-indicator', true);

```

That will use the default indicator (which is the JS notifications, which may get annoying). To use a custom indicator, you can use the ID of the element to fill with text instead:

```
$editor->setAttribute('data-tinymce-maxlength-indicator', '#Content-MaxLength-Indicator');

```

### Google Link Tracking

[](#google-link-tracking)

The settings in this module use classes on the HTMLEditorField. To allow google link tracker, add the class **google-link-tracking** to the HTMLEditorField.

```
$editor = HTMLEditorField::create('Content')->addExtraClass('google-link-tracking');

```

### Extras

[](#extras)

I have added some utility classes for removing the buttons you won't need in certain situations. Adding these classes to HTMLEditorField will change the HTMLEditorField (it will only remove using CSS, so JS calls can still call them...)

- email-friendly : Remove the 'Styles' dropdown
- limited : Remove most buttons (the last 2 lines) except the bold, italic, underline, strike through, styles, hr &amp; charmap
- limited-with-links : Same as limited, but keeps the links plugin

###  Health Score

19

↓

LowBetter than 10% of packages

Maintenance0

Infrequent updates — may be unmaintained

Popularity18

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity41

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

### Community

Maintainers

![](https://www.gravatar.com/avatar/873db53f59bc2f8309c506d1b56313b0c7d8c7b3160eb1700ee0754d060f9767?d=identicon)[mi3ll](/maintainers/mi3ll)

---

Top Contributors

[![mellm0](https://avatars.githubusercontent.com/u/229937?v=4)](https://github.com/mellm0 "mellm0 (6 commits)")

### Embed Badge

![Health badge](/badges/milkyway-silverstripe-htmleditorfield-extras/health.svg)

```
[![Health](https://phpackages.com/badges/milkyway-silverstripe-htmleditorfield-extras/health.svg)](https://phpackages.com/packages/milkyway-silverstripe-htmleditorfield-extras)
```

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
