Drupal နဲ့ ဝက်ဘ်ဆိုက်တွေ တည်ဆောက်တော့မယ် ဆိုရင် မဖြစ်မနေ သုံးသင့်တဲ့ Module တစ်ခုကတော့ Views module ပါ။ Views ကို သုံးပြီး Drupal ဆိုက်တစ်ခုမှာ ရှိတဲ့ Data တွေကို ကြိုက်တဲ့ ပုံစံနဲ့ ပြန်ထုတ်လို့ပြလို့ ရပါတယ်။ ဝက်ဘ်ဆိုက်တစ်ခုမှာ ပါတဲ့ မူလစာမျက်နှာ (Home page), မာတိကာ (Table of Contents), လအလိုက်/ နှစ်အလိုက်/ စာရေးသူအလိုက်/ အုပ်စုတူအလိုက် အကြောင်းအရာတွေ၊ ဆောင်းပါးတွေ (Monthly, Yearly, By Author, By Category articles), ခေါင်စဉ်တွေပဲ စုထားတဲ့ အုပ်စုလေးတွေ (Blocks of Contents), Slide Show စတဲ့ အင်တာနက် စာမျက်နှာတစ်ခုမှာ မြင်ရတဲ့ အစိတ်အပိုင်း အားလုံးကို Views module နဲ့ သူ့ရဲ့ ဆက်စပ် module တွေကို သုံးပြီး ဖန်တီးလို့ ရပါတယ်။ Drupal အကြောင်းလေ့လာရင် Views ကို ဖယ်ထားလို့ကို မရတာပါ။
Views ကိုသုံးပြီး RSS Feed, JSON, XML, Excel file, PDF File တွေကိုလည်း ထုတ်လို့ ရပါတယ်။ အဲဒီလို အစွမ်းထက်တဲ့ Views module လို အလားတူကို ကျန်တဲ့ ဘယ် CMS မှာမှ မရနိုင်သေးဘူးဆိုတာ လူသုံးများတဲ့ CMS တော်တော်များများကို သေသေချာချာ လေ့လာဖူးရင်၊ သေသေချာချာ သုံးဖူးတဲ့ သူဆိုရင် လက်ခံနိုင်ပါလိမ့်မယ်။
တကယ်တော့ Views ဟာ စွမ်းဆောင်ရည် မြင့်တဲ့ Smart Query Builder တစ်ခုပါ။ ကိုယ့်ဘက်က လုံလောက်တဲ့ အချက်အလက် (Content) တွေကို စနစ်တကျ ထည့်သွင်းပေးထားပြီး၊ ကိုယ်ကလည်း စနစ်တကျ ပြန်ထုတ်ယူတတ်မယ် ဆိုရင် အထက်မှာ ဖော်ပြခဲ့တဲ့ အရာတွေအားလုံးကို Code တစ်ကြောင်းမှ ရေးစရာ မလိုဘဲ ချက်ခြင်း ပြန်ထုတ်ပေး နိုင်ပါတယ်။ လိုအပ်ရင် Custom PHP Code တွေနဲ့ MySQL Query တွေကို Views ထဲမှာ ထည့်သုံးပြီး ပိုအဆင်မြင့်တဲ့ Query တွေကို ဖန်တီးနိုင်ပါသေးတယ်။ ရလာတဲ့ Output တွေကိုလည်း Cache လုပ်ထားနိုင်တဲ့ အတွက် တစ်ခါ Published လုပ်ထားပြီးရင် Update ထပ်လုပ်စရာ သိပ်မလိုတဲ့၊ Anonymous user တွေများတဲ့ အွန်လိုင်း မဂ္ဂဇင်း၊ သတင်းစာ။ News portal လို ဆိုက်တွေမှာ အလွန် အသုံးဝင်ပါတယ်။
Views ကို သုံးနိုင်တဲ့ အခြေအနေ အချို့ကို နမူနာ အနေနဲ့ မြင်သာအောင် ပြောရမယ်ဆိုရင်
နောက်ထပ် အများကြီး ရှိပါသေးတယ်။ User Requirement နဲ့ Developer ရဲ့ ဖန်တီးနိုင်စွမ်းကို မူတည်ပြီး Views ကို အမျိုးမျိုး သုံးလို့ ရပါတယ်။
လက်တွေ့ ဉပမာ ပြရမယ် ဆိုရင် mmshare မှာ မြင်နေရတဲ့ စာမျက်နှာတွေနဲ့ "Most Popular Articles", "Fresh Articles", "Similar Articles" "မှတ်ချက်များ" စတဲ့ Block တွေဟာ Views ကို သုံးပြီး လုပ်ထားတာပါ။ Footer မှာ မြင်နေရတဲ့ Drupal Tips & Tricks, Web Performance, Resources for Self Study စတာတွေကလည်း Views နဲ့ လုပ်ထားတာပါ။ အဲဒီ Block တွေအောက်က More Drupal Articles..., More Performance Tips..., More Self Study Tips... စတာတွေကို နှိပ်လိုက်လို့ မြင်ရတဲ့ စာမျက်နှာတွေကလည်း Views နဲ့လုပ်ထားတဲ့ page တွေ ဖြစ်ပါတယ်။ အဲဒီလို ဖြစ်အောင်လို့ Code တစ်ကြောင်းမှ ရေးစရာ မလိုသလို၊ Template ထဲထိ ဝင်ပြင်ရတာမျိုးလည်း လုပ်စရာ မလိုပါဘူး။
Views ရဲ့ အသုံးဝင်ပုံတွေကို ရေးပြရရင်တော့ ပြီးမှာ မဟုတ်ပါဘူး။ အခုမိတ်ဆက်ပေးခဲ့တာတွေက အကြမ်းဖျင်း၊ အပေါ်ယံပဲ ရှိပါသေးတယ်။ အတိုချုပ် ပြောရရင်တော့ Webstie တစ်ခုမှာ မြင်နေရတဲ့ Text, Audio, Video Content တွေကို ပုံစံအမျိုးမျိုး၊ အခြေအနေ အချိန်အခါ အမျိုးမှာ User အဆင့်အတန်း အလိုက် ပုံဖော်ပြသချင်တဲ့ အနေအထားမျိုးမှာဆိုရင် View ကို သုံးလို့ ရပါတယ်။ Views module ဟာ လောလောဆယ် Version 3 ခု ရှိပါတယ်။ Views 1 က Drupal 5, Views 2 က Drupal 6 အတွက် ဖြစ်ပြီး၊ Views 3 ကတော့ Drupal 7 အတွက် ဖြစ်ပါတယ်။ Views 2 နဲ့ Views 3 ဟာ လူအသုံး အများဆုံး ဖြစ်တဲ့အတွက် သူတို့ရဲ့ အစိတ်အပိုင်းတွေနဲ့ အသုံးပြုနည်းတွေကို သီးခြား ဖော်ပြပေးပါမယ်။
ဆက်ရန်...
Comments
Lei Wai (not verified)
Tue, 11/29/2011 - 21:01
Permalink
Views အကြောင်း drupal.org
Views အကြောင်း drupal.org မှာဖတ်ပေမဲ့ သိပ်နားမလည်ပါဘူး... ;(
mmshare admin က "Views 2 နဲ့ Views 3 ဟာ လူအသုံး အများဆုံး ဖြစ်တဲ့အတွက် သူတို့ရဲ့ အစိတ်အပိုင်းတွေနဲ့ အသုံးပြုနည်းတွေကို သီးခြား ဖော်ပြပေးပါမယ်။ " လို့ဆိုတာကြောင့် .. အဲဒါကိုဖတ်ချင်ပါတယ် :)
မြန်မြန်ရေးပြီးတင်ပေးပါအုံးနော်.....
ကျေးဇူးအများကြီးတင်ပါတယ်.......
chitsnow (not verified)
Wed, 02/22/2012 - 23:50
Permalink
Most Popular Articles
အစ်ကို တစ်ခုလောက်ထပ်မေးချင်လို့ပါ... :)
အစ်ကို ပြောသလို "Most Popular Articles" Block ကို View နဲ့ ထုတ်မယ်ဆိုရင် Statistics module ကိုသုံးဖို့လိုအပ် ပါသလား။ Tutorial တွေမှာ Statistics module တွေသုံးဖို့လိုတယ် လို့ ရေးထားတာ ဖတ်ရလို့ပါ။
ဒါမှမဟုတ်... ဘယ်လို လုပ်ရင်ရနိုင်မလဲ ဆိုတာ ပြောပြပေးပါလား အစ်ကို :D
everlearner
Thu, 02/23/2012 - 09:13
Permalink
Must use staticstics module
Hi Sis,
Yes, you have to use Statistics module.
This module is built-in with Drupal installation.
By default, this module was disabled and you need to enable to see the staticstics.
After enabled, you can get a Filter in Views, that can create "Popular Articles" or "Most Read Articles", "Today Popular Articles", "Weekly Popupar Articles" etc after combined with other time filters.
Please try and let me know if you have any problem, as well as your Drupal version.
Chit Snow (not verified)
Thu, 02/23/2012 - 21:45
Permalink
Is that true?
Thanks bro, I got it "Most Popular Articles" block :)
I enable "Count content views" (Administer >Reports > Access log settings > Count content views) first. If not "Most Popular Articles" is not working. :( Is that true?
I will try another "Today Popular Articles" , "Weekly Popular Articles".
Thanks you again.
Add new comment