Prepare The Modules
You can follow these steps to prepare the required modules.
- Download Views module from http://drupal.org/project/views.
- Extract it to to sites/all/modules/ or sites/default/modules/.
- Log in to your Drupal website as administrator, then click menu Administer - Site Building - Modules.
- Enable the Statistics, Views, and Views UI modules, then save your configuration.
- Configure the Statistics module by clicking menu Administer - Reports - Access log settings.
- Enable the Count content views option, then save the configuration.
You can follow these steps to build and customize the view.
- Click menu Administer - Site Building - Views.
- Enable the popular view.
- This view is ready to use now. But, I want to make some modification from its default setting. So, I click on the Edit link.
- I want to modify the Popular (block), this block will display list of popular content all this time, so I click the Popular (block) tab.
- In the Basic settings part, I click on the Use pager value (in picture below the value is Yes).
Scroll down the page. In this form, I choose No because I don't want to use pager. Then, I click the Update button.
- I also change the Items to display to 10 and More link to No. The way to do this is same like the previous step.
- I don't want to display the total views number in the list. So, I click on the Node statistics: Total views from the Fields part.
Scroll down the page. In this form, I give a check on Exclude from display then, I click the Update button.
- I only want to display the node with type blog. So, in the Filters part, I click on the + (plus) sign.
Scroll down the page. In the form like this, I give a check on Node: Type option then, I click the Add button.
Then, the form like this will appear. I choose the Is one of option and check the blog checkbox. After that I click the Update default display button.
- Click Save button. Now, this view is already customized just like what I want.
Now, we just need to display that view as a block.
- Click menu Administer - Site building - Block.
- Scroll down the page and search for Popular content block. There might be two blocks named Popular content. Only one of them is the view that we have created before, and the other one is the block from the Statistics module. You can check it by enabling both of them. The one we have created before has no "All time :" letters in its content.
No comments:
Post a Comment