Hi,
I'm learning grocery CRUD, i think it's awesome... thanks!
I'd like to change CKEditor configuration, hiding unessential items in toolbar etc.
Can you point me in the right direction?
Thanks,
Antonio
⚠ In case you've missed it, we have migrated to our new website, with a brand new forum. For more details about the migration you can read our blog post for website migration. This is an archived forum. ⚠
Posted 07 February 2013 - 13:57 PM
Hi,
I'm learning grocery CRUD, i think it's awesome... thanks!
I'd like to change CKEditor configuration, hiding unessential items in toolbar etc.
Can you point me in the right direction?
Thanks,
Antonio
Posted 07 February 2013 - 14:26 PM
Posted 07 February 2013 - 14:35 PM
Under application/config/grocery_crud.php youi will find these lines:
//You can choose 'ckeditor','tinymce' or 'markitup' $config['grocery_crud_default_text_editor'] = 'ckeditor'; //You can choose 'minimal' or 'full' $config['grocery_crud_text_editor_type'] = 'minimal';
Other than that you need to go to assets/grocery_crud/js/jquery_plugins/config/jquery.ckeditor.config.js and change there whatever you need.
Posted 07 February 2013 - 16:17 PM
Thank you for your reply.
I'm looking at assets/grocery_crud/js/jquery_plugins/config/jquery.ckeditor.config.js right now:
$(function(){ $( 'textarea.texteditor' ).ckeditor({toolbar:'Full'}); $( 'textarea.mini-texteditor' ).ckeditor({toolbar:'Basic',width:700}); });
Now I'd like to change the toolbar appearance using something like this (taken from here):
// This is actually the default value. config.toolbar_Full = [ { name: 'document', items : [ 'Source','-','Save','NewPage','DocProps','Preview','Print','-','Templates' ] }, { name: 'clipboard', items : [ 'Cut','Copy','Paste','PasteText','PasteFromWord','-','Undo','Redo' ] }, { name: 'editing', items : [ 'Find','Replace','-','SelectAll','-','SpellChecker', 'Scayt' ] }, { name: 'forms', items : [ 'Form', 'Checkbox', 'Radio', 'TextField', 'Textarea', 'Select', 'Button', 'ImageButton', 'HiddenField' ] }, '/', { name: 'basicstyles', items : [ 'Bold','Italic','Underline','Strike','Subscript','Superscript','-','RemoveFormat' ] }, { name: 'paragraph', items : [ 'NumberedList','BulletedList','-','Outdent','Indent','-','Blockquote','CreateDiv','-','JustifyLeft','JustifyCenter','JustifyRight','JustifyBlock','-','BidiLtr','BidiRtl' ] }, { name: 'links', items : [ 'Link','Unlink','Anchor' ] }, { name: 'insert', items : [ 'Image','Flash','Table','HorizontalRule','Smiley','SpecialChar','PageBreak' ] }, '/', { name: 'styles', items : [ 'Styles','Format','Font','FontSize' ] }, { name: 'colors', items : [ 'TextColor','BGColor' ] }, { name: 'tools', items : [ 'Maximize', 'ShowBlocks','-','About' ] } ];
but I'm lost :(
Posted 07 February 2013 - 18:47 PM
I think I found out how to configure CKEditor using jquery.
In jquery.ckeditor.config.js:
$(function(){ $( 'textarea.texteditor' ).ckeditor( $.noop,{toolbar_Full:[['Undo', 'Redo'], ['Bold', 'Italic', 'Underline'], ['NumberedList', 'BulletedList'], ['JustifyLeft','JustifyCenter','JustifyRight','JustifyBlock']], width:700 }); $( 'textarea.mini-texteditor' ).ckeditor({toolbar:'Basic',width:700}); });
Thanks for your help!
Posted 07 February 2013 - 18:56 PM
You can also do this,
open this file assets/grocery_crud/texteditor/ckeditor/config.js and do something like this,
CKEDITOR.editorConfig = function( config ) { // Define changes to default configuration here. For example: // config.language = 'fr'; // config.uiColor = '#AADC6E'; CKEDITOR.config.toolbar_MyBasic = [['Bold','Italic','Underline','Strike','Subscript','Superscript','-','RemoveFormat']]; //config.toolbar = 'MyBasic'; };
and then on the assets/grocery_crud/js/jquery_plugins/config/jquery.ckeditor.config.js you can have something like this
$(function(){ $( 'textarea.texteditor' ).ckeditor({toolbar:'Full'}); $( 'textarea.mini-texteditor' ).ckeditor({toolbar:'MyBasic',width:700}); });
Posted 14 May 2013 - 23:02 PM
My config.js
But the ckeditor call the full.
Posted 19 July 2014 - 13:21 PM
You can also do this,
open this file assets/grocery_crud/texteditor/ckeditor/config.js and do something like this,
CKEDITOR.editorConfig = function( config ) { // Define changes to default configuration here. For example: // config.language = 'fr'; // config.uiColor = '#AADC6E'; CKEDITOR.config.toolbar_MyBasic = [['Bold','Italic','Underline','Strike','Subscript','Superscript','-','RemoveFormat']]; //config.toolbar = 'MyBasic'; };and then on the assets/grocery_crud/js/jquery_plugins/config/jquery.ckeditor.config.js you can have something like this
$(function(){ $( 'textarea.texteditor' ).ckeditor({toolbar:'Full'}); $( 'textarea.mini-texteditor' ).ckeditor({toolbar:'MyBasic',width:700}); });
This is interesting. Can you also show a similar method using tinyMCE? Thank you very much! :)
Posted 27 March 2015 - 06:03 AM
You can customize the toolbar in the way you like comfortable...
To add a CKEditor instance with custom toolbar setting, insert the following JavaScript call to your code:
CKEDITOR.replace( 'textarea_id', { toolbar: [ { name: 'document', items: [ 'Source', '-', 'NewPage', 'Preview', '-', 'Templates' ] }, // Defines toolbar group with name (used to create voice label) and items in 3 subgroups. [ 'Cut', 'Copy', 'Paste', 'PasteText', 'PasteFromWord', '-', 'Undo', 'Redo' ], // Defines toolbar group without name. '/', // Line break - next group will be placed in new line. { name: 'basicstyles', items: [ 'Bold', 'Italic' ] } ] });