This is kind of long, but you will get the idea.
NOTE: If you get a 404 File Not Found then 10 to 1 it is the javascript paths.
Setup for assets
At the bottom of you view add this code:
Code:
<!-- ckeditor.js, load it only in the page you would like to use CKEditor -->
<script src="<?php echo asset('ckeditor/ckeditor.js');?>"></script>
<!-- This is used in controllers/admin/Dashboard.php
If used just under controllers then remove the ../
-->
<!-- add responsive filemanager to ckeditor. -->
<script>
CKEDITOR.replace('textarea-ckeditor',{
filebrowserBrowseUrl : '../assets/filemanager/dialog.php?type=2&editor=ckeditor&fldr=',
filebrowserUploadUrl : '../assets/filemanager/dialog.php?type=2&editor=ckeditor&fldr=',
filebrowserImageBrowseUrl : '../assets/filemanager/dialog.php?type=1&editor=ckeditor&fldr='
});
</script>
The form take note of the form id and name:
PHP Code:
<!-- Textareas and Editor Content -->
<form action="page_forms_components.html" method="post" class="form-horizontal" onsubmit="return false;">
<!-- CKEditor, you just need to include the plugin (see at the bottom of this page) and add the class 'ckeditor' to your textarea -->
<!-- More info can be found at http://ckeditor.com -->
<div class="form-group">
<!--<label class="control-label" for="textarea-ckeditor">CKEditor</label>-->
<div class="col-md-12">
<textarea id="textarea-ckeditor" name="textarea-ckeditor" class="ckeditor"></textarea>
</div>
</div>
</form>
<!-- END Textareas and Editor Content -->
Filemanager assets/filemanager/config/config.php
PHP Code:
/*
|--------------------------------------------------------------------------
| path from base_url to base of upload folder
|--------------------------------------------------------------------------
|
| with start and final /
| I point this to my images folder because thats all that will be uploaded.
| You can change this if you want to.
*/
'upload_dir' => '/assets/images/',
/*
|--------------------------------------------------------------------------
| relative path from filemanager folder to upload folder
|--------------------------------------------------------------------------
|
| with final /
|
*/
'current_path' => '../images/',
/*
|--------------------------------------------------------------------------
| relative path from filemanager folder to thumbs folder
|--------------------------------------------------------------------------
|
| with final /
| DO NOT put inside upload folder
|
*/
'thumbs_base_path' => '../images/thumbs/',
That will get you up and running using the filemanager with CKEditor.
The rest will be up to you to configure, there is not enough room to add everything here...
asset_helper can be found here:
asset_helper
What did you Try? What did you Get? What did you Expect?
Joined CodeIgniter Community 2009. ( Skype: insitfx )