CodeIgniter Forums
Installing Ckeditor - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: External Resources (https://forum.codeigniter.com/forum-7.html)
+--- Forum: Addins (https://forum.codeigniter.com/forum-13.html)
+--- Thread: Installing Ckeditor (/thread-74189.html)



Installing Ckeditor - ronniebel - 08-16-2019

I'm a newbie to CodeIgniter and I'm trying to install Ckeditor in my app. I need step by step instructions for that. Any ideas where I can find that?


RE: Installing Ckeditor - Avega Soft - 08-17-2019

(08-16-2019, 09:13 PM)ronniebel Wrote: I'm a newbie to CodeIgniter and I'm trying to install Ckeditor in my app. I need step by step instructions for that. Any ideas where I can find that?

Use this guide link http://www.webpreparations.com/how-to-integrate-ckeditor-in-codeigniter-using-bootstrap/


RE: Installing Ckeditor - website - 08-17-2019

it's quite simple, look here:
https://github.com/websiteinfo/CodeIgniter-Materialize-Blog-App/blob/master/application/views/posts/edit.php#L15
in form add id="editor1" in textarea (line 15)
and
https://github.com/websiteinfo/CodeIgniter-Materialize-Blog-App/blob/master/application/views/templates/footer.php#L34
in footer script ckeditor (line 34-37)


RE: Installing Ckeditor - ronniebel - 08-17-2019

(08-17-2019, 12:10 AM)Avega Soft Wrote:
(08-16-2019, 09:13 PM)ronniebel Wrote: I'm a newbie to CodeIgniter and I'm trying to install Ckeditor in my app. I need step by step instructions for that. Any ideas where I can find that?

Use this guide link http://www.webpreparations.com/how-to-integrate-ckeditor-in-codeigniter-using-bootstrap/

Thank you very much. This guide is good and I followed every step, but for some reason, the page is not loading. Any ideas?

https://spokaneesl.com/ckeditor/ckeditor.php[url=https://spokaneesl.com/ckeditorckeditor.php][/url]


RE: Installing Ckeditor - Avega Soft - 08-17-2019

(08-17-2019, 08:20 PM)ronniebel Wrote:
(08-17-2019, 12:10 AM)Avega Soft Wrote:
(08-16-2019, 09:13 PM)ronniebel Wrote: I'm a newbie to CodeIgniter and I'm trying to install Ckeditor in my app. I need step by step instructions for that. Any ideas where I can find that?

Use this guide link http://www.webpreparations.com/how-to-integrate-ckeditor-in-codeigniter-using-bootstrap/

Thank you very much. This guide is good and I followed every step, but for some reason, the page is not loading. Any ideas?

https://spokaneesl.com/ckeditor/ckeditor.php[url=https://spokaneesl.com/ckeditorckeditor.php][/url]

Check your app log-file and web-console browser


RE: Installing Ckeditor - Wouter60 - 08-18-2019

In CI, you never address php files directly. All url's must point to a controller and a method inside that controller (unless you need the index method).
The textarea that you want to combine with CKEditor must be in a view.
You load the view in a controller.

Example:
View is (...)\application\views\test_ckeditor.php

Controller is (...)\application\controllers\Editor.php
(Keep in mind that a controller must have a name that starts with a capital letter).
PHP Code:
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
class 
Editor extends CI_Controller
{
 
 function test()
 
 {
 
    $this->load->view('test_ckeditor');
 
 }


Now, the url is https://spokaneesl.com/editor/test
This will show you the page with the CKEditor textarea. The "editor" segment in the url is the controller; the "test" segment is the method (= function) inside the controller.


RE: Installing Ckeditor - InsiteFX - 08-18-2019

Classic editor with default styles:

Code:
<html lang="en">

<head>
 <meta charset="utf-8">
 <meta name="robots" content="noindex, nofollow">
 <title>Classic editor with default styles</title>
 <script src="https://cdn.ckeditor.com/4.12.1/standard-all/ckeditor.js"></script>
</head>

<body>
 <textarea cols="80" id="editor1" name="editor1" rows="10" data-sample-short>&lt;p&gt;This is some &lt;strong&gt;sample text&lt;/strong&gt;. You are using &lt;a href=&quot;https://ckeditor.com/&quot;&gt;CKEditor&lt;/a&gt;.&lt;/p&gt;</textarea>
 <script>
   CKEDITOR.replace('editor1', {
     height: 260,
     width: 700,
   });
 </script>
</body>

</html>

Classic editor with custom styles:

Code:
<html lang="en">

<head>
 <meta charset="utf-8">
 <meta name="robots" content="noindex, nofollow">
 <title>Classic editor with custom styles</title>
 <script src="https://cdn.ckeditor.com/4.12.1/standard-all/ckeditor.js"></script>
</head>

<body>
 <textarea cols="80" id="editor2" name="editor2" rows="10" data-sample-short>&lt;p&gt;This is some &lt;strong&gt;sample text&lt;/strong&gt;. You are using &lt;a href=&quot;https://ckeditor.com/&quot;&gt;CKEditor&lt;/a&gt;.&lt;/p&gt;</textarea>
 <script>
   CKEDITOR.replace('editor2', {
     height: 260,
     /* Default CKEditor styles are included as well to avoid copying default styles. */
     contentsCss: [
       'http://cdn.ckeditor.com/4.12.1/full-all/contents.css',
       'https://ckeditor.com/docs/vendors/4.12.1/ckeditor/assets/css/classic.css'
     ]
   });
 </script>
</body>

</html>



RE: Installing Ckeditor - ronniebel - 08-19-2019

Thanks for all your support with this. It was my mistake. The controller from the tutorial was not loading properly because of my routing. That's fixed now and it works.