[Drupal Views] How to sort users according to the number of nodes they posted?

| | 1 min read

You might encounter a situation where you might have to sort users by the number of nodes they posted using Drupal Views. Drupal Views does not provide a ready-made solution for sorting the users according to the number of posts. However there is a work around to achieve this effect. Read on to find out more.

Follow the steps below to find to make it working.

  • Create a View of nodes.
  • Next Enable - Use Aggregation
  • Next add one content: nid field and one user: name field (with the relationship).
  • After performing the above steps you will have to set count for the nid and group by the uid. Apply this to the Sort Criteria to get it working.

Hope that helps.

The easiest way to solve a Drupal issue is to hand it to the Drupal experts. Do you need professional help in building your Drupal site? We can provide a wide range of Drupal services to help you deploy your Drupal site easily and quickly. Get in touch with us to know more.