Take the 2-minute tour ×
Drupal Answers is a question and answer site for Drupal developers and administrators. It's 100% free, no registration required.

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
1  
Fivestar module have hooks to load this. drupal.org/project/fivestar –  Nikhil M Jun 21 '12 at 7:31
add comment

1 Answer 1

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
add comment

Your Answer

 
discard

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.