[EXTENSION] fckeditor-integration

Please add comments, questions and bugs here.

There is also a Issue-Tracker, which can be used.

http://code.google.c…ion/issues/list

Christian

There is a new Version of this Extension.

Configured CSS-Files wouldn't be used.

Therefore I made a small API change.

The configparameter "css" is no more awailable.

There is a new Configparameter "config". in this assoc-array you can set all Parameter known from fckconfig.js

To set the CSS-File of the editorarea you have to set config to:

"config" => array("EditorAreaCSS"=>Yii::app()->baseUrl.'/path/to.css',)

You can see all (documented) Parameter in the [tt]fckconfig.js[/tt] or at

http://docs.fckedito…uration_Options

Christian

Hello,

thanks for you extension!

I have one, perhaps simple, question. What does the property 'model' mean:

'model' => $pages.

What do i need to set in $pages?

thanks

It is a datemodel.

See:

http://www.yiiframew…start.first-app

There is a Model "User" in the Guide.

Lets assume every User has one webpage for his profile, the property is called 'content'.

$user = User::model()->findByPK();


<?php $this->widget('application.extensions.fckeditor.FCKEditorWidget',array(


            "model"     =>  $user,


            "property"  =>  'content',


            "height"    =>  '400px',


            "width"     =>  '100%',


            "fckeditor" =>  Yii::app()->basePath."/../fckeditor.php",


            "css"       =>  Yii::app()->baseUrl.'/css/index.css'


) ); ?>


Christan

Ok, thank you!

Another question:

I have the following code, but i get an error that says: Property "FCKEditorWidget.property" is not defined.

I can't see why…

<div class="form">


<?php echo CHtml::form(); ?>





<?php echo CHtml::errorSummary($user); ?>





<div class="row">


<?php echo CHtml::activeLabel($user,'username'); ?>


<?php echo CHtml::activeTextField($user,'username',array('size'=>65,'maxlength'=>128)); ?>


</div>


<div class="row">


<?php echo CHtml::activeLabel($user,'password'); ?>


<?php echo CHtml::activeTextField($user,'password',array('size'=>65)); ?>





</div>





<div class="row">


<?php echo CHtml::activeLabel($user,'email'); ?>


<?php echo CHtml::activeTextField($user,'email',array('size'=>65)); ?>


<?php echo Yii::app()->baseUrl; ?>


</div>


<div class="row">


<?php echo CHtml::activeLabel($user,'profile'); ?>





<?php $this->widget('application.extensions.fckeditor.FCKEditorWidget',array(


            "model"     =>  $user,


            "property"  =>  'profile',


            "height"    =>  '400px',


            "width"     =>  '100%',


            "fckeditor" =>  Yii::app()->basePath."/../fckeditor.php",


            "css"       =>  Yii::app()->baseUrl.'/css/index.css'


) ); ?>


</div>








<div class="row action">


<?php echo CHtml::submitButton($buttonLabel,array('name'=>'submitPost')); ?>








</div>





</form>

Thanks, thats my fault.

There may be an error in the documentation.

Please don't use 'property', use 'attribute' instead and download Version 0.3.0 or above.

I will release a new version with a correct documentation, soon.

Christian

error FCKEditorWidget.php

line 57:



if(!isset($this->fckBasePath)){


			throw new CHttpException(500,'"fckBasePath" have to be set!');


		}


Hi Everyone, Not too sure if I can post here but here goes.

I'm quite new ( completely new ) with yii, looking to switch from cakephp.

I've been trying to integrate fckeditor to the new 'blog' application on SVN. Is this as easy as it sounds and I am missing something or is there something more. Here is the issue I am having and the steps I have done.

  1. I have unpack the fckeditor-integration to /protected/extentsion/fckeditor

  2. I have unpacked the fckeditor to /protected ( documentation is not to clear here, it says the 'webroot'. I've only got it to work in '/protected/fckeditor')

  3. Here is the code I placed in /views/post/create.php

3a. I could only get it to work by removing css and changing the base path.



<h2>Create New Post</h2>





<?php $this->renderPartial('_form', array(


	'post'=>$post,	


	'buttonLabel'=>'Create',


)); ?>





<?php $this->widget('application.extensions.fckeditor.FCKEditorWidget',array(


            "model"     =>  $post,


            "attribute"  =>  'content',


            "height"    =>  '400px',


            "width"     =>  '100%',


            "fckeditor" =>  Yii::app()->basePath."/fckeditor/fckeditor.php",            


) );?>


Now all I get is the fckeditor widget displaying 'My Yii Blog Page Not Found' content.

Any help would be greatly appreciated.

Roger

The actual FCKEditor files should not be inside the protected folder, they should be one level up the tree -

So if your installation is like

/myapp/protected/ (Your application files)

Then the fckeditor should be placed in

/myapp/fckeditor/

and your inclusion should be



<?php $this->widget('application.extensions.fckeditor.FCKEditorWidget',array(


            "model"     =>  $post,


            "attribute"  =>  'content',


            "height"    =>  '400px',


            "width"     =>  '100%',


            "fckeditor" =>  Yii::app()->basePath."/../fckeditor/fckeditor.php",            


) );?>


Thanks notzippy,

I have done what you have suggested, but I am still having issues. Am I missing something?

PHP Error

Description

require_once(/var/webapp/WebRoot/blog/protected/…/fckeditor/fckeditor.php) [<a href='function.require-once'>function.require-once</a>]: failed to open stream: No such file or directory

Source File

/var/webapp/WebRoot/blog/protected/extensions/fckeditor/views/fCKEditorWidget.php(41)

Php cannot find this file, can you verify it exists and is accessible ? This should be included in the fckeditor you unpacked.

/var/webapp/WebRoot/blog/fckeditor/fckeditor.php

What about using the absolute path?

Ok - Sorry about that I did have the fckeditor in a subfolder of its self.

Now when I bring up the page I get the widget but all I see is a:

My Yii Blog

Page Not Found

I am trying to create a post with the fckeditor.

Just an update.

I've noticed I had place the code in the wrong file.

So I moved the code to /views/post/_form.php.

I still get the fckeditor widget with 'My Yii Blog

Page Not Found' and thats all.



<?php echo CHtml::activeLabel($post,'content'); ?>


<?php $this->widget('application.extensions.fckeditor.FCKEditorWidget',array(


            "model"     =>  $post,


            "attribute"  =>  'content',


            "height"    =>  '400px',


            "width"     =>  '100%',


            "fckeditor" =>  Yii::app()->basePath."/../fckeditor/fckeditor.php",  


            //"css"       =>  Yii::app()->baseUrl.'/css/index.css'          


) );?>


After hitting a save button on fckedit widget I have got next:



A has no properties


FCKDialogCommand()fckeditorcode_gec... (line 70)


FCKToolbarButton()fckeditorcode_gec... (line 88)


FCKToolbarButtonUI_onclick(click clientX=0, clientY=0, Object Name=Save Label=Save Tooltip=Save Style=0 State=0)fckeditorcode_gec... (line 87)


CancelEvent(click clientX=0, clientY=0)fckeditorcode_gec... (line 37)


[Break on this error] var FCKDialogCommand=function(A,B,C,D,E,F,G,H){this.Name=A;this.Title=B;this.Url...


Tried that on default User model and attribute - profile.

Any clue on that ?

I think the save button on the FCKEditor simply does a form.submit() So if your editor is not inside a form it will fail…

Of course you can always hide the save button by defining your own toolbars.

Quote

Just an update.

I've noticed I had place the code in the wrong file.

So I moved the code to /views/post/_form.php.

I still get the fckeditor widget with 'My Yii Blog

Page Not Found' and thats all.

Where do you get the "Page not found" ?

Do you get the complete 404-Page? Or an error within the FCK Editor-Area?

Christian

Ohh that could be the error.

I should include a small Demo-Application with the FCK-Editor.

Christian

Quote

Just an update.

I've noticed I had place the code in the wrong file.

So I moved the code to /views/post/_form.php.

I still get the fckeditor widget with 'My Yii Blog

Page Not Found' and thats all.



<?php echo CHtml::activeLabel($post,'content'); ?>


<?php $this->widget('application.extensions.fckeditor.FCKEditorWidget',array(


            "model"     =>  $post,


            "attribute"  =>  'content',


            "height"    =>  '400px',


            "width"     =>  '100%',


            "fckeditor" =>  Yii::app()->basePath."/../fckeditor/fckeditor.php",  


            //"css"       =>  Yii::app()->baseUrl.'/css/index.css'          


) );?>


I was having the same problem. It turns out i haven't configured the fckBasePath property (should be one level up the fckeditor directory, see the documentation for the class in the source file). By doing this i stopped getting the page not found text in the place where the widget should be.

Anyway, now i get another 'page not found' but this time from apache, and the weird thing is that the route it claims doesn't exists is correct. This error is always where the editor should be, the rest of the page displays normally.

If anybody has any tips on how to solve this i would be grateful.

I am sorry, just to interrupt. But I finally got the FCKeditor to work for me.

And I wrote a page in the cookbook on how to get it to work.

http://www.yiiframew…doc/cookbook/4/

If this howto isn’t complete, any of you guys could always update it.  ;)