这篇我们看下标签云的实现, 效果图:
参考文章: http://drupalchina.cn/forum/310.html
1、下载 Tagadelic 和 Cumulus
http://drupal.org/project/tagadelic
http://drupal.org/project/cumulus
下载 http://pratul.in/files/cumulus.js 放入cumulus文件夹中
下载支持中文的swf放入 icumulus文件夹中(http://drupalchina.cn/sites/default/files/cumulus.zip)。
2、到模块中启用 Tagadelic 和 Cumulus
3、添加标签
结构-区块 ,点击 Add cumulus block
填写标题啊什么的, 要注意的就是填写显示区域:
4、保存刷新下,我们就能看到标签云了。不过这时候还会报2个错。
Notice: Undefined index: voc in theme_tagadelic_weighted() (line 334 of public_html/sites/all/modules/tagadelic/tagadelic.module).
Notice: Trying to get property of non-object in theme_tagadelic_weighted() (line 334 of public_html/sites/all/modules/tagadelic/tagadelic.module).
Notice: Undefined index: voc in theme_tagadelic_weighted() (line 335 of public_html/sites/all/modules/tagadelic/tagadelic.module).
Notice: Trying to get property of non-object in theme_tagadelic_weighted() (line 335 of public_html/sites/all/modules/tagadelic/tagadelic.module).
5、解决错误:
修改 tagadelic.module 的334 335行为:
if(isset($vars['voc'])){
if (count($terms) >= variable_get('tagadelic_block_tags_' . $vars['voc']->vid, 12)) {
$output .= theme('more_link', array('title' => t('more tags'), 'url' => "tagadelic/chunk/{$vars['voc']->vid}"));
}}
再刷新下, ok~~
只为更简单! --Rydiy