Allows adding CSS classes to HTMLEditorFields for styling hooks
JavaScript PHP
Switch branches/tags
Nothing to show
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
javascript
.editorconfig
.scrutinizer.yml
README.md
_config.php
composer.json

README.md

#HtmlEditorStylingHook#

A module to allow easy adding of CSS classes to SilverStripe's HtmlEditorField instances.

###Simple example###

HomePage.php

<?php

class HomePage extends Page {

	public function getCMSFields() {
		$fields = parent::getCMSFields();

		$fields->dataFieldByName('Content')->setAttribute('data-mce-body-class', 'HomePage');

		return $fields;
	}

}

editor.css

.HomePage {
	background: #000;
	color: #fff;
}

Currently only set up for use in the CMS. To use with a different HtmlEditorConfig instance, simply copy the approach in _config.php