Ever wondered how to display popular content from your Drupal powered site, either via Drupal blocks, either as seperate page?

 

On picture above you can see most popular blog posts on my blog 15:05:01 2013-10-16.

 

How to get this done? Part 1 - Core modules

You will need to enable Drupal core module - Statistics:

 

Once enabled you will need to head to admin/config/system/statistics, and check box next to Count content views



NB. Only after enabling Count Content views - will actually start to count hits on you content pages. If you have a lot of content, it will start counting from 0.


When statistics enabled, we are ready to move on - to part 2.

 

Part 2: Creating views with popular content

  • Go to admin/structure/views/add

(If you haven't yet enabled views module, go to drupal.org  - download views module, extract it to sites/all/modules and enable from modules page)

  • Give a name you wish, like Popular content
  • Check a box next to create a block
  • Press - Continue and edit

Here is the configuration I have on my blog.

  • Under fields - add fields you'd like to display
  • Under Sort Criteria, remove default filter and add filter Total views
Thats it. Now you have your block created with popular posts availiabe on your Drupal site. Next head to admin/structure/block, search for your newl created block, and put in under some region, where you'd like to display content of your popular blog posts