Recently for a project we were developing, we had a need to show top X bloggers may be top 5 or top 10 bloggers in a block and after some Googling and searching the drupal.org (d.o) site I could not find anything that fit our needs.
The need for a moduleThen I decided to write a module that will solve the problem but in a dynamic and flexible way and came up with the idea for Top X Contributors module. If you want to download the module and try it, you can download it here or take a look at the code at GitHub.com here.
What does it do?The module is very simple, it just shows the top X (X - no. of authors/contributors to show which is configurable) contributors in a HTML list in form of a block for each content type in your Drupal site. Something like below:
Step to followDownload the module here, and follow the instruction to show the top - “Content Type” contributors block where content type is any node type you want be it blog, page or a custom type you created like news or event anything.
- Install the module (copy it to your sites/all or sites/all/custom folder)
- Turn on the module from SITEURL/admin/build/modules - or use drush :)
- Then change the settings as per your need: at admin/settings/topxcontributors - as shown below:
- Go to the blocks page SITEURL/admin/build/block/list - and place the newly generated blocks in the block regions you want. (if you want configure the blocks and change the title to whatever you like for example : Top 5 bloggers). (Click to Enlarge)
- And you are done. See the output as in the first picture above “Steps to follow”
ImprovementsI wanted each node type’s contributor or author count to be configurable but that above module solved our problem for now so it will not be done for now. If anyone wants to contribute contact me or comment below and help me in GitHub. Any help will be appreciated, I’ll try for a CVS account at Drupal as well yet again.
ConclusionI hope the module solves a very small but common problem in Drupal in many community and blogs this might be a very needed and sought after feature but not achieved easily. If views could have done it, it would have been amazing but none the less here is a solution for you all to try out.
I have tried to give out what I had developed internally for YIPL hope it helps someone. :) Happy Drupalling.