2017 © Pedro Peláez
 

silverstripe-module htmleditor

Multiple HTMLEditor configurations (even on the same page)

image

peda/htmleditor

Multiple HTMLEditor configurations (even on the same page)

  • Friday, January 15, 2016
  • by peda
  • Repository
  • 1 Watchers
  • 0 Stars
  • 2 Installations
  • JavaScript
  • 0 Dependents
  • 0 Suggesters
  • 1 Forks
  • 1 Open issues
  • 1 Versions
  • 0 % Grown

The README.md

CustomConfigHtmlEditor

Installation

This module must be installed in a module folder called htmleditor, (*1)

Usage

The following block adds a new editor configuration called reduced within _config.php, (*2)

//config defintion
$reduced = HtmlEditorConfig::get('reduced');
$reduced->disablePlugins('table');
$reduced->setButtonsForLine(1, 'bold', 'italic', 'underline', 'strikethrough', 'separator', 'charmap', 'separator', 'sslink', 'unlink', 'code');
$reduced->setButtonsForLine(2);
$reduced->setButtonsForLine(3);
$reduced->setOption('force_br_newlines',true);
$reduced->setOption('force_p_newlines',false);
$reduced->setOption('convert_newlines_to_brs',false);
$reduced->setOption('invalid_elements','p');
$reduced->setOption('paste_auto_cleanup_on_paste',true);
$reduced->setOption('paste_text_sticky',true);
$reduced->setOption('paste_text_sticky_default',true);
$reduced->setOption('paste_remove_styles',true);
$reduced->setOption('paste_remove_styles_if_webkit',true);
$reduced->setOption('paste_strip_class_attributes',true);
$reduced->setOption('language', 'de');
$reduced->enablePlugins(array('ssbuttons' => "../../../framework/thirdparty/tinymce_ssbuttons/editor_plugin_src.js"));

To create a new instance of the editor just do the following:, (*3)

CustomHtmlEditorConfig::withConfigName('reduced', 'Field', 'Field Lable');

The Versions

15/01 2016

dev-master

9999999-dev https://github.com/peda/silverstripe-customconfightmleditor

Multiple HTMLEditor configurations (even on the same page)

  Sources   Download

BSD-3-Clause

The Requires

 

by Peter Rainer

config tinymce silverstripe htmleditor