2017 © Pedro Peláez
 

silverstripe-vendormodule htmleditorstylinghook

Allows adding CSS classes to HTMLEditorFields for styling hooks

image

kinglozzer/htmleditorstylinghook

Allows adding CSS classes to HTMLEditorFields for styling hooks

  • Wednesday, June 6, 2018
  • by kinglozzer
  • Repository
  • 1 Watchers
  • 8 Stars
  • 792 Installations
  • JavaScript
  • 0 Dependents
  • 0 Suggesters
  • 2 Forks
  • 0 Open issues
  • 4 Versions
  • 22 % Grown

The README.md

HtmlEditorStylingHook

A module to allow easy adding of CSS classes to SilverStripe's HtmlEditorField instances., (*1)

Simple example

HomePage.php, (*2)

<?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, (*3)

.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)

The Versions

06/06 2018

dev-master

9999999-dev https://github.com/kinglozzer/htmleditorstyinghook

Allows adding CSS classes to HTMLEditorFields for styling hooks

  Sources   Download

BSD-3-Clause

The Requires

 

css silverstripe htmleditorfield styling

06/06 2018

2.0.0

2.0.0.0 https://github.com/kinglozzer/htmleditorstyinghook

Allows adding CSS classes to HTMLEditorFields for styling hooks

  Sources   Download

BSD-3-Clause

The Requires

 

css silverstripe htmleditorfield styling

18/02 2016

1.x-dev

1.9999999.9999999.9999999-dev https://github.com/kinglozzer/htmleditorstyinghook

Allows adding CSS classes to HTMLEditorFields for styling hooks

  Sources   Download

BSD-3-Clause

The Requires

 

css silverstripe htmleditorfield styling

14/02 2014

1.0.0

1.0.0.0 https://github.com/kinglozzer/htmleditorstyinghook

Allows adding CSS classes to HTMLEditorFields for styling hooks

  Sources   Download

BSD-3-Clause

The Requires

 

css silverstripe htmleditorfield styling