阿舍最近在Drupal 上打东西的时候都觉得怕怕的,因为怕不小心没按到「储存」,文章就白打了,所以,就去找看看有没有什么可以自动储存的功能,最好能像Blogger.com 那种,自动储存之后就会把按钮变成灰色不能按的那种功能,结果,阿舍找到了「AutoSave」这个模组,它是可以自动储存文章,但是不会把按钮变成灰色的哩! 不过,阿舍试了还不错用,所以今天就来介绍一下这个「AutoSave」模组。
装了这个模组之后,它会在大德指定的内容类型编辑文章时自动做储存的动作,但是,「AutoSave」模组并不是真的把资料存到原始的文章( Node )中,而是定时的储到另一个地方去(真正存到那个地方,阿舍就没去研究了...呵! ) ,只有在大德开启一篇文章来编辑时,如果之前有自动储存过,「AutoSave 」模组就会去检查开启的文章内容是不
是比「AutoSave」模组储存的时间早,如果是,「AutoSave」模组就会跳出来问说,是不是要换成「AutoSave」模组存的版本,如果大德选择"是",那就会换成「AutoSave」的版本了,是和一般自动储的作法不太一样的哩!不过,阿舍是用的还满顺的喔! !建议大德们有需要,就装来用用, "有好,没坏"的....。
以下就是「AutoSave」模组的安装设定说明啰!! ( 啊! 好久没写模组了,感觉有点生疏了哩!! ...=___=!!)
1.下载和安装 老样子,先到http://drupal.org/project/autosave下载模组回来,然后解压缩后放到sites\all\modules的资料夹里。
2.启用模组 接着到/admin/build/modules来启用AutoSave模组。 AutoSave 模组很单纯的,不需要任何的相依模组,也不需要安装其他额外的档案,它自己用到的jQuery.field.js 档,己自带在模组中了,而且也不用设定权限来的..。
3.设定AutoSave模组 接下来就到/admin/settings/autosave去设定AutoSave ,这里只有二个参数要设定,说明如下: 「Autosave after this amount seconds has passed:」 这个是设定多久自动储存一次,以秒为单位,预设是30秒,就看大德的需要了,阿舍有给它调成10秒过,就发现,才新增文件,还没开始打字就己经先存过一次了,所以,阿舍就还是调回30秒哩!! 「Run in stealth mode」 再来的这个就是设定要不要显示已储档的讯息,也就是每次AutoSave自动储存时,要不要显示讯息,说有自动储档,阿舍是没勾(有勾是不要显示喔! ),因为阿舍还是觉得有秀讯息比较有fu来的...呵呵!!
4.在内容类型启用AutoSave 就算已经启用AutoSave模组,各位大德去编辑文章时,还是会发现没有看到自动储存的功能,这是因为AutoSave不会自动套用到所有的内容类型去的,各位大德们要到/admin/content/types去选一个内容类型,然点右边的「编辑」,之后,展开下面的「工作流程设定」,就会看到一个方框,旁边有一串「Enable Autosave to add /edit forms for this node type」的英文,把它打勾后,按「储存」这样,这类内容类就会有自动储存的功能了。 现在,就来新增一个刚刚启用AutoSave 的Node ( 文章),过一会儿,应该就会从下面跳出「Form AutoSaved」的讯息了...
本文选自:阿舍的Drupal 架站经验谈,谢谢!
----------------------------------------------------------------------------------------------------------------------------------
Autosave
The Autosave module automatically saves a snapshot of your content type form using AJAX. If the user's browser or machine dies while editing a node; the edits will be presented to the user the next time they return to the node. The user may toggle back and forth between the last saved version and the version with the edits that were lost and select which of these they would like to continue with. How often a form is autosaved as well as which content types to enable autosave for are admin configurable. This module requires: jQuery Update (Drupal 5 version only) jQuery Field Plugin (modified version included with module) 6.x-2.x VersionNOTE: if used with JS editor requires latest dev version of WYSIWYG module and patch listed below. - 6.x-2.0 version is a complete re-write to remove dependencies on TinyMCE.
- this version is now tied to the WYSIWYG module and currently is known to work with FCK, CK and TinyMCE 3.0 editors but requires the 6.x-2.x-dev version of WYSIWYG with this patch: http://drupal.org/node/614146#comment-2193764; this patch should be committed soon and will eventually be expanded to include other editors.
- As of version 6.x-2.8 there is now support for the CK editor without the use of the WYSIWYG module.
Drupal 6 release funded by ConsumerSearch.com, a NY Times Company. Also, thanks to jidefor providing required WYSIWYG patches for this. NOTE: Autosave uses a modified version of the jquery.field plugin (modified since it doesn't support Drupal field naming conventions very well). This version of the plugin was based on jquery 1.2 and does not work with jquery 1.3. Rev 6.x-2.7 DOES support jquery 1.3 and should still support jq 1.2. Please raise an issue if you find that it doesn't. TODO:Would likely not be a bad idea to have a theme function to allow developers to theme Autosave's popup form. Feel free to contribute a patch for this. |