欢迎各位兄弟 发布技术文章

这里的技术是共享的

You are here

Drupal6.0 Bata4 安裝 FCKeditor - WYSIWYG HTML editor Choosing on which forms to use a WYSIWYG editor

shiping1 的头像

Drupal6.0 Bata4 安裝 FCKeditor - WYSIWYG HTML editor

在 Drupal6.0 上頭要安裝 WYSIWYG 編輯器, 之前大家提過的 TinyMCE, Whizzywig, YUI 都不能用, 只有 FCKeditor 能安裝.

說一下安裝的方式:
1. 首先下載 fckeditor-6.x-1.x-dev.tar.gz
http://ftp.drupal.org/files/projects/fckeditor-6.x-1.x-dev.tar.gz
將它上傳到 /modules 解壓縮, 也可以在 PC 端解壓縮後上傳到 /modules
2. 再下載 FCKeditor_2.5.tar.gz(目前的最新版)
http://sourceforge.net/project/downloading.php?group_id=75348&filename=F...
將它上傳到 /modules/fckeditor 解壓縮, 也可以在 PC 端解壓縮後上傳到 /modules/fckeditor
做到這個步驟目錄應該是如下的這樣:
modules
|--fckeditor
|--fckeditor
|--_samples
|--editor

3. 修改 /modules/fckeditor/fckeditor/fckconfig.js
var _FileBrowserLanguage = 'php' ; // asp | aspx | cfm | lasso | perl | php | py
var _QuickUploadLanguage = 'php' ; // asp | aspx | cfm | lasso | perl | php | py
再它的下方加上
FCKConfig.QuickUploadLanguage = _QuickUploadLanguage;

4. 修改 /modules/fckeditor/fckeditor/editor/filemanager/connectors/php/config.php
$Config['Enabled'] = true ;
$Config['UserFilesPath'] = 'files/' ; //因為安裝 Drupal6.0 Bata4 原本就會有一個使用者資料夾,就用這個吧!
$Config['UserFilesAbsolutePath'] = '/drupal_root/files/' ; //這個是上面 UserFilesPath 的絕對路徑

5. 在剛剛設定的 UserFilesPath 之下建立四個資料夾 File, Image, Flash, Media
並將權限設成 777.

6. 在 Drupal 的管理頁面啟用 FCKeditor 模組.
admin -> build -> modules

7. 授於使用者使用 FCKeditor 的權限
admin -> user -> permissions

8. 建立 FCKeditor 的 Profile(內建的兩個 Profile Default & Advanced 可以拿來更改)
admin -> settings -> fckeditor
toolbar 選取 default
語系選取 ZH(繁體中文)

9. 設置過濾器, 授予使用者 Full HTML
admin -> settings -> filters

將底下的標籤加入配置. (請將全形<改成html標簽 < , > 改成html標簽 >)
<a> <p> <span> <div> <h1> <h2> <h3> <h4> <h5> <h6> <img> <map> <area>
<hr> <br> <br /> <ul> <ol> <li> <dl> <dt> <dd> <table> <tr> <td> <em>
<b> <u> <i> <strong> <font> <del> <ins> <sub> <sup> <quote> <blockquote>
<pre> <address> <code> <cite> <embed> <object> <strike> <caption>

將換行轉換器 "Line break converter" 停用.

10. 設定 FCKeditor
admin -> settings -> fckeditor ->
10.1 Basic setup
Allow users to customize FCKeditor appearance: false
10.2 Visibility settings
Allow users to customize FCKeditor appearance: 1
Use inclusion or exclusion mode: Exclude fields, will disable the editor on all selected fields
Force simplified toolbar - choose inclusion mode: Include fields, will only load the simplified toolbar for the selected fields
10.3 Editor appearance
Default state: enabled
Show disable/enable rich text editor toggle: true
Use FCKeditor in a popup window: false

11. Disable Javascript
admin -> settings -> performance

這樣就可以使用 FCKeditor 了! 其它的小細節可以依自己的需要調整.

kiku's 的頭像

Re: Drupal6.0 Bata4 安裝 FCKeditor - WYSIWYG HTML editor

這裡有安裝教學影片
不過裡頭沒提到關於image /file browser的部份(覺得這部份是fckeditor較tinymce好用的地方)

来自 http://drupaltaiwan.org/forum/20071220/1759
 

Choosing on which forms to use a WYSIWYG editor

This short guide describes how to configure several of the most popular WYSIWYG editors for Drupal to show only on forms where they are necessary, so they are available for site visitors, but don’t get in the way of administrative or site-building tasks.

 

If you have a WYSIWYG editor installed (such as the popular TinyMCE or FCKeditor, among others), it can potentially get in the way of the settings/configuration forms on many of Drupal’s administration pages (often inserting HTML code in places that break your settings). As such it is best to disable the WYSIWYG editor ahead of time for all areas of your site “except” for the content creation/publication pages where it is actually required. Though the process for doing this varies between editors, fortunately most include the means to allow you to choose whether they should be enabled or disabled for any given area of your site. It’s much better to choose the few places where the WYSIWYG editor “should” show up, rather than the countless places where it should “not”.

FCKeditor

  1. 1.
    FCKeditor is enabled by default on just about every text area on the site (not good). Go to Administer > Site configuration > FCKeditor and click the “edit” link next to FCKeditor Global Profile(admin/settings/fckeditor/editg). Settings made here apply globally to all FCKeditor profiles, so you only have to make the settings one time.
  2. 2.
    Expand the “Visibility settings” fieldset. Change the Use inclusion or exclusion mode setting from exclude to include.
  3. 3.
    Select all of the text in the Fields to exclude/include box and delete it.
  4. 4.
    Move down to the currently-empty Paths to exclude/include box, and paste in the following:
    node/*
    user/*
    comment/*
  5. 5.
    You can add as many other paths as you need to, so that the WYSIWYG editor appears on only those pages.

TinyMCE

  1. 1.
    TinyMCE is already set by default to show up only on certain pages where it’s necessary. In case you’ve adjusted the default setting though, it can be changed by going to Administer > Site configuration > TinyMCE (admin/settings/tinymce) and then clicking on the “edit” link next to each of your profiles (TinyMCE does not have a global setting). Expand the “Visibility” fieldset in order to adjust the Show tinymce on specific pages setting.

Similar steps may be necessary for other WYSIWYG editors. Please refer to the documentation as well as the settings page of your WYSIWYG editor module.

2 comments

Add your comment

there a WYSIWYG editor call CLEditor

can i add it to Drupal.

thank you

1

To my knowledge, no, CLEditor does not yet work with Drupal. I did a quick search and was unable to find a standalone module to integrate it, and while it has been proposed for the Wysiwyg API module, there is an issue preventing it from working currently.

Hope this helps.

来自 http://www.absolutecross.com/tutorials/drupal/choosing-on-which-forms-to-use-a-wysiwyg-editor

 

普通分类: