views cloud module:2010年02月04日星期四
適用於:Drupal初學者,想更改Drupal theme外觀 的人,對CSS有興趣的人,對PHP有興趣的人,以前用Dreamweaver的人,以前用其他Blog CMS的人。本文用Drupal6.14,想在Drupal中使用Flash,詳見本文的環境。
views cloud module在drupaltaiwan.org已有模組介紹,其使用方法介紹如下。
(一)功能:用drupal.org的views cloud module可將下方圖一左方的分類做成圖一右方的Tag Cloud(標韱雲)。
(二)下載Drupal 6.x可用的模組:到views cloud project 下載6.x-1.1版本--views_cloud-6.x-1.1.tar。
(三)使用方法:Views Cloud module裡的readme.txt有很清楚的使用說明--views cloud readme,節譯片段如下。
- Dependencies: views [需要有views module]
- Install[安裝] :
- Copy the views_cloud folder to the modules (sites/all/modules) folder in your installation.[到views cloud project 下載6.x-1.1版本,解壓縮後將views_cloud folder放入sites/all/modules]
- Enable the module using Administer -> Site Building -> Modules (/admin/build/modules)[在<網站建置><模組><Views>下,確定<views>模組已啟用後,Click Views cloud左的<啟用>]
- Configure a view to use Views Cloud. Note that Views Cloud comes with two default views that are disabled by default. They may help you get started with your own clouds.
[用view module做一個Tag Cloud(標韱雲)的view。注意:Views Cloud有兩個設好的view,它們可幫助了瞭解如何做一個Tag Cloud(標韱雲)。]- These two sample default views are:
[這兩個設好的view可用<網站建置><Views><列表>看到--cloud_tags、cloud_user_posts,點其右的編輯可看到這兩個view是如何做的。]- cloud_tags: A common tag cloud.[這個tag cloud將所有的term列出來,打http://localhost/drupal1/taxonomy/term可看到,如圖九。]
- cloud_user_posts: A cloud of user names, weighted by the user's # of posts.[這個tag cloud將使用者依其po文多寡列出,鍵入http://localhost/drupal1/user/7/posts可看到,如圖十。
- These two sample default views are:
- Configuration for a Tag Cloud (most common)
[做個Tag Cloud(標韱雲)]- Create a new View at Administer -> Site Building -> Views (admin/build/views). Give it a name like "tagcloud".
[Click <網站建置><Views><Add>開始,在<View name>處給個名字,例如YYYYYYYY,<View type>用內容節點] - Add a field by clicking the "+" (plus) icon under the "Fields" section. Note that any fields you add will NOT be part of the tag cloud, they are part of the listing the user will see when they click on a tag. You may choose to not add any fields at all but instead change the view "Row Style" to "Node" instead of "Fields".
[Click< Fields>右的"+"號來增加field,注意:這些filed並不會在tag cloud顯示出來,而是Click某個Tag後顯示。若不加field也可將<Row Style>改為Node--見圖二。] - Add an argument by clicking the "+" (plus) icon under the "Arguments" section. Add a "Taxonomy: Term ID" argument. For the "Action to take if argument is not present" option, choose "Summary, sorted ascending". After saving the argument, you may then choose "Cloud" as the summary display style. IMPORTANT NOTE: The view in the preview may not look very much like a "cloud" because the Views Cloud CSS may not be loaded on the page.
[Click<Arguments>右的"+"號來增加argument,出現<Defaults:Add arguments>畫面後選"Taxonomy: Term ID"並Click<更新>--見圖三(星號處),接著出現的"Action to take if argument is not present"畫面,選擇"Summary, sorted ascending"並Click<更新>--見圖四(星號處),接著出現的"Change summary style for argument分類:TermID",選擇"Cloud"並Click<更新>--見圖五(星號處),完成後如圖五] - Add a filter by clicking the "+" (plus) icon under the "Filters" section. Add the "Taxonomy: Vocabulary" filter, and restrict the list to items within whatever vocabularies you would like the cloud to include.
[Click<過濾器>右的"+"號來增加filter,出現Default: Add filter畫面選擇"Taxonomy: Vocabulary"並Click<Add>--見圖六(星號處),接著出現的"Default"Configure 過濾器 分類:vocabulary"畫面,選擇想顯示term的vocabulary,在圖七(星號處)選擇"is one of"--RoadMap、BookRelated、程式開發、討論區,共四個vocabulary,並Click<更新>,如圖七(星號處)。如此就完成了] - Add a "Page" display from the left-hand side of the view configuration. Give it a path to where you would like the tag links to direct.
[加個頁面,見圖二左星號處)] - Add a "Block" display from the left-hand side of the view configuration.
[加個區塊,見圖二左星號處)] - Save your view.[Click<儲存>]
- Enable your new block at Administer -> Site Building -> Blocks (admin/build/block).
[Click <網站建置><區塊
>, 在區塊
YYYYYYYY 右的下拉選單選擇<左欄>,就出現圖一右方的Tag Cloud(標韱雲)]注意:若font太大,則可在Click <Argument/Style>(圖五)之後,改<Number of font sizes>、<Font size adjustment>、<Weight to size algorith>--如圖十一。
- Create a new View at Administer -> Site Building -> Views (admin/build/views). Give it a name like "tagcloud".
- Configuration for a Cloud based on arbitrary integers (Instructions abbreviated, see the instructions above for full steps.)
[本段不做!]- Create a new View.
- Add fields you would like to be in the cloud. Add a field that will be used as the weight for each item (such as number of comments).
- Click the "Style" option under the "Basic settings" option and change it to "Cloud".
- Create a block display and save your view. Support ------- If you experience a problem with Views Cloud or have a problem, file a request or issue on the Views Cloud queue at http://drupal.org/project/issues/views_cloud. DO NOT POST IN THE FORUMS. Posting in the issue queues is a direct line of communication with the module authors.
圖二:
圖三:
圖四:
圖五:
圖六:
圖七:
圖八:
圖九:
圖十:
圖十一:
本文的環境是:
- Drupal 6.14。
- apache server設在Windows XP上,以http://localhost/drupal為例。
- 所有的檔案在c:/xampp/內,以下的路徑均相對於c:/xampp/。
- 各檔案均用vim editor打開,行數以vim內的行數為準。
- 主機是遠振資訊cPanel環境。
附加檔案 | 大小 |
---|---|
viewCloud-1.JPG | 51.98 KB |
viewCloud-2.JPG | 41.12 KB |
viewCloud-3.JPG | 37.41 KB |
viewCloud-4.JPG | 52.46 KB |
viewCloud-5.JPG | 43.05 KB |
viewCloud-6.JPG | 37.16 KB |
viewCloud-7.JPG | 27.39 KB |
viewCloud-8.JPG | 25.97 KB |
viewCloud-9.JPG | 72.08 KB |
viewCloud-10.JPG | 11 KB |
viewCloud-11.JPG | 52.45 KB |
Re: views cloud module
請問jesselue~
你的標籤雲有flash的效果嘛?
Re: views cloud module
沒有flash效果。不太清楚flash效果是指什麼?
我曾在xuite的blog上試過一個我認為的flash tag cloud--見 flash tag cloud ,其上方每一個移動的圖片即為一個Tag,試著mouse over該圖片,並click,即會顯示該tag的所有文章。
不知是否即是你所說的flash效果?
若是,我曾將如何做到寫在 --> http://blog.xuite.net/jesselue/4664?st=tag&p=1&w=b6a367f370ee7102a03973c... 系列文章中,但不知是否可用在Drupal?因很久沒用flash,也忘了當初怎麼做的,你的問題倒提醒了我,原先是想將xuite中sidebar中的tag改成flash才做這些實驗的,但是完成後,因受限於xuite對flash code的限制,只好用div放到上方。若這是你所講的tag cloud的flash效果,有興趣,大家再來研究如何在drupal中作flash tag。
2/27小聚若見面,可詳細切磋。