Drupal7_8: 標籤雲

這篇我們看下標籤雲的實現, 效果圖:



參考文章: 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


發佈了62 篇原創文章 · 獲贊 21 · 訪問量 19萬+
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章