drupal ckeditor模块配置上传图片及文件(IMCE,ckfinder)

来源:互联网 发布:淘宝以下不是保健食品 编辑:程序博客网 时间:2024/05/04 15:33

一、用IMCE模块上传图片

效果图如下:


首先启用IMCE模块

然后按照下面三步就可以轻松搞定

   1. Open /sites/modules/ckeditor/ckeditor.config.js

     打开modules/ckeditor目录下的ckeditor.config.js

   2. Uncomment the following lines (remove "//") in ckeditor.config.js:

      //config.extraPlugins += (config.extraPlugins ? ',imce' : 'imce' );

      //CKEDITOR.plugins.addExternal('imce', Drupal.s

ettings.ckeditor.module_path + '/plugins/imce/');

   3. Add button to the toolbar. The button name is: IMCE. 

      For example if you have a toolbar with an array of buttons defined as follows:

      ['Link','Image']

      simply add button at the end of array (or somewhere in the middle):

      ['Link','Image','IMCE']

      (remember about single quotes).

添加IMCE后在其toolbar上出现相应的图片,如上面的效果图


二、ckfinder来实现上传图片及文件

1、http://ckfinder.com/下载最新版本的ckfinder

2、解压文件放在sites/modules/ckeditor/里面,完成后的路径如下:

3、在用户管理下配置权限allow CKFinder file uploads(如果没有找到,则说明文件放置有问题,请参考第二步)

   4、打开CKFinder 配置文件 (sites/all/modules/ckeditor/ckfinder/config.php) 

         I) 删除 CheckAuthentication() 函数

        (不要担心,这个函数在filemanager.config.php还有一个)

          II) $baseDir = resolveUrl($baseUrl);下面添加一行

        require_once '../../../../includes/filemanager.config.php';

   5、在站点配置中配置ckeditor,在File browser settings中选中ckfinder

   6、修改settings.php(一般路径为 sites/default/settings.php),去掉变量$cookie_domain前面的 ‘#’或‘//,即是启用变量$cookie_domain。注意settings.php为只读文件,修改之前请更改属性,修改完毕再更改为只读

   7、到此,配置结束,如下图:


http://hi.baidu.com/marvin1023/blog/item/707a2faef29fdc044a36d66b.html


原创粉丝点击