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

  •     

profile picture

How to install ckeditor image uploader in grocery crud?



Rashed
  • profile picture
  • Member

Posted 14 December 2015 - 10:34 AM

I want to install image uploader in ckeditor for free. How can I do this in grocery crud?


Paul Savostin
  • profile picture
  • Member

Posted 15 December 2015 - 22:01 PM

Hi! First of all, in ckeditor present CKFinder uploader, but he is not free and in opening window display text that it requires license.
 

So what would be the best free alternative? It name is KCfinder - http://kcfinder.sunhater.com/
 

On the site very clear documentation and in any case if you will not understand it I wrtie below what to do

1)Download kcfinder

2)Copy it to texteditor folder

3)in kcfinder/conf/config.php enable config  'disabled' => false and set path to upload in 'uploadURL' => "your_folder",

4)add some code in ckeditor config in assets/grocery_crud/js/jquery_plugin/config/jquery.ckeditor.config.js

 

$(function() {
        $('textarea.texteditor').ckeditor({
                language: 'en',
                extraPlugins : 'placeholder,youtube'
                toolbar: [
                ['Source','-','Save','NewPage','Preview','-','Templates'],
	  	['Cut','Copy','Paste','PasteText','PasteFromWord','-','Print', 'SpellChecker', 'Scayt'],
		['Undo','Redo','-','Find','Replace','-','SelectAll','RemoveFormat'],
		['Form', 'Checkbox', 'Radio', 'TextField', 'Textarea', 'Select', 'Button', 'ImageButton', 'HiddenField'],
		'/',
		['Bold','Italic','Underline','Strike','-','Subscript','Superscript'],
		['NumberedList','BulletedList','-','Outdent','Indent','Blockquote'],
		['JustifyLeft','JustifyCenter','JustifyRight','JustifyBlock'],
		['Link','Unlink','Anchor','Youtube'],
		['Image','Flash','Table','HorizontalRule','Hhs','Smiley','SpecialChar','PageBreak'],
		'/',
		['Styles','Format','Font','FontSize'],
		['TextColor','BGColor'],
		['Maximize', 'ShowBlocks','-','About','CreatePlaceholder']
	       
        ],
                //this code below for kcfinder           
                filebrowserBrowseUrl: '/assets/grocery_crud/texteditor/ckeditor/kcfinder/browse.php?opener=ckeditor&type=files',
                filebrowserImageBrowseUrl: '/assets/grocery_crud/texteditor/ckeditor/kcfinder/browse.php?opener=ckeditor&type=images',
                filebrowserFlashBrowseUrl: '/assets/grocery_crud/texteditor/ckeditor/kcfinder/browse.php?opener=ckeditor&type=flash',
                filebrowserUploadUrl: '/assets/grocery_crud/texteditor/ckeditor/kcfinder/upload.php?opener=ckeditor&type=files',
                filebrowserImageUploadUrl: '/assets/grocery_crud/texteditor/ckeditor/kcfinder/upload.php?opener=ckeditor&type=images',
                filebrowserFlashUploadUrl: '/assets/grocery_crud/texteditor/ckeditor/kcfinder/upload.php?opener=ckeditor&type=flash'
                
       
                
        });
        $('textarea.mini-texteditor').ckeditor({
                language: 'en',
                toolbar: 'Basic',
                width: 700
        });
});

And you are done!


Amit Shah
  • profile picture
  • Member

Posted 17 December 2015 - 23:53 PM

Fantastic 1 Paul - I remember implementing CKEditor in past - I had to do quite some modifications.!! Nice on brother - you rock.


Paul Savostin
  • profile picture
  • Member

Posted 18 December 2015 - 23:03 PM

Thanks Amit :)