<?xml version="1.0"?>
<record><wiki id="wiki?page_id=35">
	<page_name>widget:editor</page_name>
	<page_id>35</page_id>
	<page_title>widget:editor</page_title>
	<content>==widget:editor fields.ini directive==

Return to [[fields.ini file]]

[[toc]]

The widget:editor directive is applicable in the [[fields.ini file]].  It specifies the type of HTML editor that should be used.  This directive is only used when [[widget:type]] is set to [[widget:type htmlarea|htmlarea]].  Xataface currently supports FCKEditor, TinyMCE, and NicEdit.

===Allowed Values===

{| class=&quot;listing listing2&quot;
|-
! Value
! Description
! Version
|-
| fckeditor
| Use [http://www.fckeditor.net/ FCKEditor].  This is the default value.
| all
|-
| tinymce 
| Use [http://tinymce.moxiecode.com/ TinyMCE editor].
| 0.6
|-
| nicedit
| Use [http://www.nicedit.com/ NicEdit].
| 1.0.5
|}

===Examples===

====Example 1: Using FCKEditor====

Given a field &apos;content&apos; that you wish to be able to edit with FCKEditor, you would have the following section in your [[fields.ini file]]:

&lt;code&gt;
[content]
    widget:type=htmlarea
    widget:editor=fckeditor
&lt;/code&gt;

Note that since FCKEditor is the default editor, the above would give the same result as:

&lt;code&gt;
[content]
    widget:type=htmlarea
&lt;/code&gt;

====Example 2: Using TinyMCE====

Further from example 1, if we wanted to use TinyMCE editor, we would change our directive to:

&lt;code&gt;
[content]
    widget:type=htmlarea
    widget:editor=tinymce
&lt;/code&gt;

====Example 3: Using NicEdit====

Further from example 1:

&lt;code&gt;
[content]
    widget:type=htmlarea
    widget:editor=nicedit
&lt;/code&gt;

==Enabling Image Uploads==

By default image uploads are disabled in these WYSIWYG editors.

===Enabling Image Uploads in FCKEditor===

# Create a directory named &apos;&apos;uploads&apos;&apos; inside your application directory. e.g.&lt;code&gt;
cd /path/to/myapp/uploads
&lt;/code&gt;
# Make the &apos;&apos;uploads&apos;&apos; directory writable by the webserver. e.g. &lt;code&gt;
chmod 777 /path/to/myapp/uploads
&lt;/code&gt;
# Edit the &apos;&apos;lib/FCKeditor/editor/filemanager/connectors/php/config.php&apos;&apos; file inside your &apos;&apos;xataface&apos;&apos; directory so that:&lt;code&gt;
$Config[&apos;Enabled&apos;] = true ;
$Config[&apos;UserFilesPath&apos;] = &apos;/url/to/myapp/uploads/&apos; ;
    // The path portion of the URL to your uploads directory.
    // e.g. if your uploads directory is accessible at
    // http://example.com/myapp/uploads, then this value should
    // be /myapp/uploads/
$Config[&apos;UserFilesAbsolutePath&apos;] = &apos;/path/to/myapp/uploads/&apos; ;
    // The absolute file system path to your uploads directory.
    // e.g. if your uploads directory is located at
    // /home/myhome/www/myapp/uploads, then this value should be
    // /home/myhome/www/myapp/uploads
&lt;/code&gt;
# Now when you click on the &quot;Add Image&quot; link in your HTML editor, it will allow you to upload images and browse existing uploaded images.

</content>
	<keywords></keywords>
	<language>en</language>
	<original_page>0</original_page>
</wiki></record>