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

一、用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


  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值