Hi,

I'm displaying a list of teasers in a View. I'd like to display the most popular node (in views) first and the least, last.

Is this possible?

Thanks!

Comments

Anonymous’s picture

Hello,

well the answer is your statistics module shipping with Drupal 5.x and higher. All you have to do is activate the module from core-optional section. Then go to: Administer -> Logs -> Access Log settings. Here navigate to the Content viewing counter settings section an activate the counter.

Now open up your desired view that lists teasers based on popularity (view counts) and choose Node: Total Hits as a sort criteria. And that should be it? Now all you teasers are sorted based on the total view count of each node.

I hope this will solve your problem.

With best regards,

Mike

Fiasst’s picture

I like not having to add more PHP or another module :)

I made use of the 'Recent Hit' criteria because its a nice mix between popularity and giving other nodes a chance to appear at the top.

One thing I noticed though, It says '1 READ' at the bottom of the full node within $links. I'd rather not show how many views these particular nodes have received. Any thoughts?

Thanks for your help!

dwees’s picture

Pretty sure this is configurable through access control. Check to see who has access to 'view page counters' or something similar.

Dave

My site: http://www.unitorganizer.com/myblog