kinglozzer/htmleditorstylinghook
最新稳定版本:2.0.0
Composer 安装命令:
composer require kinglozzer/htmleditorstylinghook
包简介
Allows adding CSS classes to HTMLEditorFields for styling hooks
README 文档
README
#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
统计信息
- 总下载量: 4.76k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 7
- 点击次数: 3
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: BSD-3-Clause
- 更新时间: 2014-04-22