widget:editor fields.ini directive
Return to fields.ini file
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 htmlarea. Xataface currently supports FCKEditor, TinyMCE, and NicEdit.
Allowed Values
| Value | Description | Version |
|---|---|---|
| fckeditor | Use FCKEditor. This is the default value. | all |
| tinymce | Use TinyMCE editor. | 0.6 |
| nicedit | Use NicEdit. | 1.0.5 |
Examples
Example 1: Using FCKEditor
Given a field ‘content’ that you wish to be able to edit with FCKEditor, you would have the following section in your fields.ini file:
[content]
widget:type=htmlarea
widget:editor=fckeditor
Note that since FCKEditor is the default editor, the above would give the same result as:
[content]
widget:type=htmlarea
Example 2: Using TinyMCE
Further from example 1, if we wanted to use TinyMCE editor, we would change our directive to:
[content]
widget:type=htmlarea
widget:editor=tinymce
Example 3: Using NicEdit
Further from example 1:
[content]
widget:type=htmlarea
widget:editor=nicedit
Enabling Image Uploads
By default image uploads are disabled in these WYSIWYG editors.
Enabling Image Uploads in FCKEditor
-
Create a directory named uploads inside your application directory. e.g.
cd /path/to/myapp/uploads -
Make the uploads directory writable by the webserver. e.g.
chmod 777 /path/to/myapp/uploads -
Edit the lib/FCKeditor/editor/filemanager/connectors/php/config.php file inside your xataface directory so that:
$Config['Enabled'] = true ; $Config['UserFilesPath'] = '/url/to/myapp/uploads/' ; // 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['UserFilesAbsolutePath'] = '/path/to/myapp/uploads/' ; // 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 -
Now when you click on the “Add Image” link in your HTML editor, it will allow you to upload images and browse existing uploaded images.
var disqus_identifier = ‘xataface.com/wiki/widget:editor’; (function() { var dsq = document.createElement(‘script’); dsq.type = ‘text/javascript’; dsq.async = true; dsq.src = ‘http://xataface.disqus.com/embed.js’; (document.getElementsByTagName(‘head’)[0] || document.getElementsByTagName(‘body’)[0]).appendChild(dsq); })(); blog comments powered by Disqus
//<![CDATA[ (function() { var links = document.getElementsByTagName(‘a’); var query = ‘?’; for(var i = 0; i < links.length; i++) { if(links[i].href.indexOf(‘#disqus_thread’) >= 0) { query += ‘url’ + i + ‘=’ + encodeURIComponent(links[i].href) + ‘&’; } } document.write(‘