Part of the EllisLab Network
   
1 of 2
1
FCK editor headache
Posted: 24 November 2006 05:08 AM   [ Ignore ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  362
Joined  11-06-2006

I’ve followed the updated FCKeditor WIKI to the tee, I’m using CI 1.5.

Heres my controller function:

 

function fck(){

  $this
->load->view('admin/fck_test');

  
}

Complex eh?

And heres my view ( fck_test )

<html>
<
body>
<
form>
<?
$this
->fckeditor->BasePath = base_url() . 'plugins/FCKeditor/';
$this->fckeditor->Value        = 'This is some <strong>sample text</strong>. You are using <a href="http://www.fckeditor.net/" >FCKeditor</a>.' ;
$this->fckeditor->Create() ;
?>
</form>
</
body>
</
html>

and running it results in a blank page with javascript errors. According to firefox, its because I havn’t set any config values perhaps? HERE

And heres the page

But where in the official docs or the wiki does it say that none of the config files are set by default???

Can someone please help me overcome this, as I really would love to get this running for my project. Surely I’m missing something?


:( :( :(

 Signature 

Cycling Tops

Profile
 
 
Posted: 24 November 2006 11:46 AM   [ Ignore ]   [ # 1 ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  362
Joined  11-06-2006

SOLVED Call me fickle, but FCKeditor can eat my shorts, I’ve discovered Xihna, much easier to configure. smile

 Signature 

Cycling Tops

Profile
 
 
Posted: 24 November 2006 02:03 PM   [ Ignore ]   [ # 2 ]  
Grad Student
Rank
Total Posts:  72
Joined  11-02-2006

You should look at http://tinymce.moxiecode.com/ as well that’s what i use

 Signature 

Apache 2 PHP 5 Ubuntu Sellersrank.com [TextMate CodeIgniter Bundle]

Profile
 
 
Posted: 25 November 2006 09:14 AM   [ Ignore ]   [ # 3 ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  362
Joined  11-06-2006

I agree TinyMCE is my favourite of the lot, its the quickest to load and easy to configure like Xinha, however I cannot warrant paying $50 per site for the image upload plugin, when I can get the same functionality in Xinha for free.

Don’t get me wrong, I appreciate that a lot of time & effort has gone into TinyMCE, and also think its worth the $50, but at present I am not selling my projects, so the free option seems best.

 Signature 

Cycling Tops

Profile
 
 
Posted: 25 November 2006 02:12 PM   [ Ignore ]   [ # 4 ]  
Research Scientist
Avatar
RankRankRankRankRankRank
Total Posts:  5887
Joined  11-23-2003

Yeah I say F(*)CK the FCK editor!

 Signature 

EE 2.0:  A designers dream becomes a developers dream | Follow me on Twitter.

Profile
 
 
Posted: 29 November 2006 01:06 PM   [ Ignore ]   [ # 5 ]  
Grad Student
Avatar
Rank
Total Posts:  39
Joined  11-15-2006

Okay I am gonna have to politely disagree here. I started with TinyMCE and it would not allow me to easily add tags to its list and it was very quirky as far as the html it produced. It is fast to load however. configuring it is problematic and documentation is so so on what the options do.

FCK so far seems much superior in its implementation but yes is slower to load. the file uploading and browsing blows away tinymce (which doesn’t have this). FCK is pretty easy to configure and you have two ways to do it (javacript file or php class from within CI).

here is how i do it in my controller in case anyone is interested. you just put the Fckeditor.php file that comes with FCK in your library folder.

$fconfig = array(
    
'CustomConfigurationsPath' => $this->config->item('base_url').'FCKeditor/myconfig.js',
    
'EditorAreaCSS' => site_url('preview_template/index/css/'.$row['template_id']),
    
'BaseHref' => 'http://localhost/~yourusername/yoursite/'
);
$this->load->library('Fckeditor', 'page_content');
        
$fck = $this->fckeditor;
$fck->BasePath = $this->config->item('base_url').'FCKeditor/';
$fck->Value = $row['page_content'];
$fck->Width = '800';
$fck->Height = '600';
$fck->Config = $fconfig;
$fck->ToolbarSet = 'mytoolbar';
$this->data['page_content'] = $fck->createhtml();

FWIW.

Profile
 
 
Posted: 29 November 2006 02:39 PM   [ Ignore ]   [ # 6 ]  
Summer Student
Total Posts:  11
Joined  11-20-2006

Or you can use TinyMCE and FCKEditor File Manager http://p4a.sourceforge.net/tinyfck

Profile
 
 
Posted: 13 December 2006 03:42 PM   [ Ignore ]   [ # 7 ]  
Grad Student
Avatar
Rank
Total Posts:  39
Joined  11-15-2006

well, I am now using XINHA. I went from TinyMCE to FCK to XINHA and they all have their ups and downs but XINHA has the best image uploader hands down (imagemanager plugin). The Xinha documentation is by far the worst (but you can search the forums), however, in order of speed it would be Tiny, Xinha, FCK. they are all pretty easy to customize once you figure out how they work.

ugh - I wish my clients could just type html into a textarea. IS IT THAT HARD?! (especially if style sheets are all setup).

Profile
 
 
Posted: 13 December 2006 04:10 PM   [ Ignore ]   [ # 8 ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  486
Joined  09-14-2006
mania - 13 December 2006 03:42 PM

ugh - I wish my clients could just type html into a textarea. IS IT THAT HARD?! (especially if style sheets are all setup).

Unfortunately, for the average user, it is.

 Signature 

Code Igniter 1.5.4 / CentOS 5 / PHP 5.2.3 / Apache 2.2.2 / MySQL 5.0.27

Profile
 
 
Posted: 15 December 2006 07:31 AM   [ Ignore ]   [ # 9 ]  
Grad Student
Rank
Total Posts:  82
Joined  05-26-2006

well, you can also have a look at SPAW editor. their soon to be released new version will allow multiple document editing via tabs(as in browsers) in a single editor instance, so there won’t be a need for multiple instances of the editor on a page! smile

Profile
 
 
Posted: 15 December 2006 01:14 PM   [ Ignore ]   [ # 10 ]  
Grad Student
Avatar
Rank
Total Posts:  39
Joined  11-15-2006

joeles - yes I know - it was a rhetorical question. smile

amit - NO not another one to try!!! sad thing is I will probably write my own at some point.

Profile
 
 
Posted: 12 April 2007 11:12 AM   [ Ignore ]   [ # 11 ]  
Grad Student
Rank
Total Posts:  51
Joined  02-12-2007

I’m having exactly the same problem with FCKEditor on my server as pickledegg2 described at the start of this thread. I’m able to load FCKeditor (more or less) but the editor just won’t display and Firebug says:

uncaught exception: Permission denied to set property Window.FCK_STATUS_NOTLOADED
[Break on this error] undefined
FCKBrowserInfo has no properties
[Break on this error] if ( FCKBrowserInfo.IsGecko )
fckeditor.html (line 186)
FCKLang is not defined
[Break on this error] window.document.dir = FCKLang.Dir ;
fckeditor.html (line 116)
uncaught exception: Permission denied to get property Window.FCKeditorAPI
[Break on this error] undefined
FCK has no properties
[Break on this error] FCK.ContextMenu={};FCK.ContextMenu.Listeners=[];FCK.ContextMenu.RegisterListener…
fckeditorcode_gec… (line 94)
FCKConfig has no properties
[Break on this error] var FCKConfig=FCK.Config={};if (document.location.protocol==‘file:’){FCKConfig.B…
fckeditorcode_gec… (line 31)
FCKBrowserInfo has no properties
[Break on this error] if ( FCKBrowserInfo.IsIE )
fckeditor.html (line 62)
FCKConfig has no properties
[Break on this error] FCKConfig.DisableEnterKeyHandler = false ;


On my development PC however FCK runs fine without errors and with exactly the same code. I guess this isn’t my week. Couldn’t get CodeCrafter to work and now this. The wiki on FCK didn’t help, tried that one twice without any luck.

Profile
 
 
Posted: 12 April 2007 11:36 AM   [ Ignore ]   [ # 12 ]  
Lab Technician
Avatar
RankRankRankRank
Total Posts:  1737
Joined  06-23-2006

joris, on your “development PC” it works fine? How does the other server (live, I presume) differ? Is there a url we can go to?

I’ve installed FCKeditor just fine on multiple sites, and it went very smoothly. No problems or errors. I was very happy with how seamless it was.

 Signature 

Mac OS X 10.4.10, Apache 1.3.3, PHP 5.2.3, CodeIgniter 1.5.x., baby!

Profile
 
 
Posted: 12 April 2007 02:20 PM   [ Ignore ]   [ # 13 ]  
Summer Student
Total Posts:  25
Joined  12-28-2006

Joris make sure your BasePath is set properly. That will certainly cause Fckeditor to fail.

My live and dev machines are setup differently, but the same configuration work on both without fail. On dev I just put everything in the web root, but on live I have the CI /system/ up a directory for security, on both however, I have a directory for libraries such as the Fckeditor, so under the web root I have:

/libraries/fckeditor/

And appropriately in the fckeditor_4/5.php’s I set the default BasePath there to the above. Works perfect, regardless of where I instantiate the editor from. Also have the Smarty helper function loading Fckeditor, very handy.

Throwing this out there, but in the past I’ve noticed that the file browser/uploader for the Fckeditor is globally accessible, ie. if anyone notices you are running Fckeditor and know how it works, they can browse directly to the file browser/uploader and start filling your box. To counter that on Linux I added an .htaccess file with a Basic Auth to keep unwanted visitors out.

Profile
 
 
Posted: 12 April 2007 05:14 PM   [ Ignore ]   [ # 14 ]  
Grad Student
Rank
Total Posts:  51
Joined  02-12-2007

Got it working!

(and I like to thank coolfactor and 3rdRRAdmin for pointing me in the right direction)

The BasePath was the problem. In fact there or various possibilities to set the BasePath correct but they largely depend how you organize your file structure.

On my development PC I have a wwwroot with several websites in it, each in its own subdirectory, while on the remote server had a different structure. Using base_url() was the solution and works for both environments providing the $config[‘base_url’] in /system/application/config/config.php was set correctly for each environment (local and remote).

In the view file:

$this->fckeditor->BasePath = base_url().‘system/plugins/fckeditor/’;

Profile
 
 
Posted: 08 October 2008 04:28 AM   [ Ignore ]   [ # 15 ]  
Summer Student
Total Posts:  24
Joined  03-23-2008

Hi guys,
I’m using spaw editor, it’s really great editor. But I have a problem: I don’t know how to fetch data from database to textarea generated by spaw(for example, when edit the contents of an acticle).
please help me, thanks!

Profile
 
 
   
1 of 2
1
 
Post Marker Legend
New Topic New posts Hot Topic Hot Topic with new posts New Poll New Poll Moved Topic Moved Topic Sticky Topic Sticky topic
Old Topic No new posts Hot Old Topic Hot Topic with no new posts Old Poll Old Poll Closed Topic Closed Topic Announcement Announcements
Theme
Change Theme
Visitor Statistics
The most visitors ever was 719, on June 06, 2008 10:16 AM
Total Registered Members: 64459 Total Logged-in Users: 21
Total Topics: 80973 Total Anonymous Users: 0
Total Replies: 435716 Total Guests: 173
Total Posts: 516689    
Members ( View Memberlist )