Drupal Answers is a question and answer site for Drupal developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm creating a website and there is a problem that I have encountered. I need to create list of posts. And each posts have a like button and shows who's liked the post exactly as in Facebook. The likes are handled by the flag module. The list of posts is in a view. What I need to do is figuring out each nid every post has in the view and pull the latest likes and the number of likes each post have.

share|improve this question
Fivestar module have hooks to load this. drupal.org/project/fivestar – niksmac Jun 21 '12 at 7:31

If this is already in a view -- you can do the flag/like counts by adding a relationship to the view (I'm assuming you're on Drupal 7). Add the 'Flags: Node flag counter' relationship and select the flag you want the counts for.

Then you can add, for each piece of content in your block or page, the 'Flags: flag counter' field. That'll appear only once you've added the relationship. Make sure to select for it to use the relationship.

Let me know if this doesn't make sense and I can elaborate a little more. :-)

share|improve this answer
This is not what I looked for. This only mentions the count not the name of the users who liked the post – user8037 Jun 24 '12 at 21:33

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.