Drupal 7: show most viewed/most popular articles
Requirements
statistics module
In Drupal 7 the statistics module is in the core, so just needs to be enabled.
It is also recommendable to install the statistics filter module. This module enables you to filter out site views by user groups (e.g. administrator). Very useful for small sites.
Configuration
Go to
configuration > statistics
or enter following URL into your webbrowser
<mywebsite>/admin/config/system/statistics or
<mywebsite>/?q=admin/config/system/statistics
mark
enable access log
count content views
And (if you have installed the module "statistics filter"), there is a box "Filter Settings", enable
Ignore administrator (User-1)
Roles To ignore: administrator
Click on "Save configuration".
To have a block where you see the most visited blog posts go to the configuration page of the statistics module. Navigate your web-browser to
<YOURSITE.com>/admin/config/system/statistics or <YOURSITE.com>/?q=admin/config/system/statistics
and enable "Count content views". Then go to
structure > blogs
and move the blog "Popular content" to the (e.g.) first sidebar. Click on "Save blocks".
Then you have to configure the "popular content" blog (otherwise it will not appear). Navigate your web-browser to
<YOURSITE.com>/admin/structure/block/manage/statistics/popular/configure or <YOURSITE.com>/?q=admin/structure/block/manage/statistics/popular/configure
and set at least one of the
Number of day's top views to display
Number of all time views to display
Number of most recent views to display
to a number, e.g. 5. Click on "Save Blog".
see, Image (not yet taken: most_visited_sites.jpg).
If you want to see a number in the teaser next to the tags, that says how many people have viewed that article,
(see image statistics_filter_read.jpeg)
set the right permissions
<YOURSITE.com>/admin/people/permissions
there mark anonymous and authenticated and administration user. Then all users can see how many people have already read an article, see image statistics_permissions_content_hits.jpeg
Add new comment