Allows adding CSS classes to H
#HtmlEditorStylingHook#
A module to allow easy adding of CSS classes to SilverStripe's HtmlEditorField
instances.
###Simple example###
HomePage.php
<?php use SilverStripe\Forms\FieldList; class HomePage extends Page { public function getCMSFields() { $this->beforeUpdateCMSFields(function (FieldList $fields) { if ($content = $fields->dataFieldByName('Content')) { $content->setAttribute('data-mce-body-class', 'HomePage'); } }); return parent::getCMSFields(); } }
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
版权声明:
1、该文章(资料)来源于互联网公开信息,我方只是对该内容做点评,所分享的下载地址为原作者公开地址。2、网站不提供资料下载,如需下载请到原作者页面进行下载。