lpa Posted July 22, 2015 Share Posted July 22, 2015 I have a field that mainly contains text that should preserve newlines. At the moment the fields textarea is defined without CKEditor or TinyMCE, but has "Newlines to XHTML Line Breaks" text formatter. The users would like to get the possibility to colorize and emphasize text with bold, italics and colors. If I change the field to use CKEditor, all the newlines are stripped away and the text with linebreaks changes to one paragraph with stripped away newlines. I know the newlines can be inserted with shift-enter, but can I preserve the current texts newlines and make it possible to paste text with newlines to preserve those newlines? How should I define this field and its WYSIWYG editor? Link to comment Share on other sites More sharing options...
diogo Posted July 22, 2015 Share Posted July 22, 2015 You could use textile http://modules.processwire.com/modules/textformatter-textile/ Not like using a color picker, but you can color a text like this: http://txstyle.org/doc/33/span Link to comment Share on other sites More sharing options...
pwired Posted July 23, 2015 Share Posted July 23, 2015 Plugins for ckeditor:http://ckeditor.com/addon/colorbuttonhttp://ckeditor.com/addon/magiclineOr dive into the config.js and do it yourself, here are a few examples to make you familiar:config.allowedContent = true; // don't filter anything, i.e. allow custom style / classes / id etc. config.enterMode = CKEDITOR.ENTER_P; // wraps everything in <p>, change it to your liking.config.forcePasteAsPlainText = true; Use google to find more. Here is also a good post to read: https://processwire.com/talk/topic/3972-ckeditor-with-attritbutes/ Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now