ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

need help in fckeditor in codeigniter 2.0.2

June 18, 2011 10:25pm

Subscribe [3]
  • #1 / Jun 18, 2011 10:25pm

    Kiran Dangol

    5 posts

    Hello everybody,
        I am having problem in using fckeditor 2.6.6 in Codeigniter 2.0.2.
    I have gone through following site which has given steps to use fckeditor in codeigniter, but that also didn’t help me.
    The link is:-
    http://codeigniter.com/wiki/FCKeditor/
    I have followed the step for codeigniter 1.7 in given above site.

    in controller file code is given below:

    <?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
    
    class Editor extends CI_Controller {
    
        function __construct(){
            parent::__construct();
        }
        
        public function index(){
            $fckeditorConfig
                = array(
                'instanceName' => 'content',
                'BasePath' => base_url().'system/plugins/fckeditor/',
                'ToolbarSet' => 'Default',
                'Width' => '100%',
                'Height' => '200',
                'Value' => ''
                );
            $this->load->library('fckeditor', $fckeditorConfig);
            $this->load->view('fckeditorView');
        }
    }

    view page code is given below:

    <?php 
    echo $this->fckeditor->Create() ; 
    ?>


    Using above steps given by the link, i got the error given below:

    Access forbidden!

    You don’t have permission to access the requested object. It is either read-protected or not readable by the server.

    If you think this is a server error, please contact the webmaster.
    Error 403

    Please anyone tell me what i have done mistake.
    Or you can help me to get best way to use to fckeditor.

    Thanks in advance.

  • #2 / Jul 07, 2011 2:27am

    Sudz

    117 posts

    I am also facing same problem can anyone?

  • #3 / Jul 08, 2011 1:22am

    Kiran Dangol

    5 posts

    Hello Sudhakar,
          Currently I am using tinymce. It is quite easy to integrate and simple to use. Or you might use ckeditor. Ckeditor is quite better than tinymce. It little bit completed to use in comparision to tinymce. I would rather choose for tinymce. It is all enough to perform.

    Visit below link in order to integrate ckeditor
    http:/codeigniter.com/wiki/CKEditor/

    Visit below link in order to integrate tinymce
    http://codeigniter.com/wiki/TinyMCE/

  • #4 / Jul 08, 2011 2:29am

    Sudz

    117 posts

    I read that document but how should i implement in codeignter 2.0.2
    please can explain in detail.
    i put tiny_mce folder into js folder which is at root.

  • #5 / Jul 08, 2011 11:15am

    Kiran Dangol

    5 posts

    after putting tinymce inside js folder, include js file in a page where you want to display editor say that page is main.php
    write code inside head

    include tiny_mce.js file //location <?php echo base_url();?>js/tinymce/jscripts/tiny_mce/tiny_mce.js
    include tb_tinymce.js.php file //location <?php echo base_url();?>js/tinymce/jscripts/tiny_mce/plugins/tinybrowser/tb_tinymce.js.php


    where base_url=www.domainname.com/

    also put below javascript in the same page //main.php

    tinyMCE.init({
            // General options
            mode : "textareas",
            theme : "advanced",
            width : 900,
            height : 400,
            plugins : "pagebreak,style,layer,table,save,advhr,advimage,advlink,emotions,iespell,inlinepopups,insertdatetime,preview,media,searchreplace,print,contextmenu,paste,directionality,fullscreen,noneditable,visualchars,nonbreaking,xhtmlxtras,template,wordcount,advlist,autosave",
    
            // Theme options
            theme_advanced_buttons1 : "save,newdocument,|,bold,italic,underline,strikethrough,|,justifyleft,justifycenter,justifyright,justifyfull,styleselect,formatselect,fontselect,fontsizeselect",
            theme_advanced_buttons2 : "cut,copy,paste,pastetext,pasteword,|,search,replace,|,bullist,numlist,|,outdent,indent,blockquote,|,undo,redo,|,link,unlink,anchor,image,cleanup,help,code,|,insertdate,inserttime,preview,|,forecolor,backcolor",
            theme_advanced_buttons3 : "tablecontrols,|,hr,removeformat,visualaid,|,sub,sup,|,charmap,emotions,iespell,media,advhr,|,print,|,ltr,rtl,|,fullscreen",
            theme_advanced_buttons4 : "insertlayer,moveforward,movebackward,absolute,|,styleprops,|,cite,abbr,acronym,del,ins,attribs,|,visualchars,nonbreaking,template,pagebreak,restoredraft",
            theme_advanced_toolbar_location : "top",
            theme_advanced_toolbar_align : "left",
            theme_advanced_statusbar_location : "bottom",
            theme_advanced_resizing : true,
    
            // Example content CSS (should be your site CSS)
            content_css : "css/content.css",
    
            // Drop lists for link/image/media/template dialogs
            template_external_list_url : "lists/template_list.js",
            external_link_list_url : "lists/link_list.js",
            external_image_list_url : "lists/image_list.js",
            media_external_list_url : "lists/media_list.js",
            
            //this code for integrating tinybrowser in tinymce
            file_browser_callback : "tinyBrowser",
            
            //this is for setting path while sending content image of editor
            document_base_url : "http://localhost/cms_code/",
            relative_urls : false,
    
            // Style formats
            style_formats : [
                {title : 'Bold text', inline : 'b'},
                {title : 'Red text', inline : 'span', styles : {color : '#ff0000'}},
                {title : 'Red header', block : 'h1', styles : {color : '#ff0000'}},
                {title : 'Example 1', inline : 'span', classes : 'example1'},
                {title : 'Example 2', inline : 'span', classes : 'example2'},
                {title : 'Table styles'},
                {title : 'Table row 1', selector : 'tr', classes : 'tablerow1'}
            ],
    
            // Replace values for the template plugin
            template_replace_values : {
                username : "Some User",
                staffid : "991234"
            }
        });


    that’s all
    remember for that you should have textarea in your page.
    This will replace your textarea by tinymce.
    Hope that will help.

  • #6 / Jul 12, 2011 8:45am

    Sudz

    117 posts

    Thanks Kiran_Dangol.

  • #7 / Aug 12, 2011 9:45am

    Majodesign

    3 posts

    Hi,

    I’ve been tested out both tiny and fceditor but on both editors I only get the textarea without any bars. But with no luck at all the only thing I get is the texarea

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases