user that have lagged this node have also flagged those nodes feature

nitram079 - November 3, 2009 - 18:45
Project:Flag
Version:6.x-2.x-dev
Component:Views integration
Category:support request
Priority:normal
Assigned:Unassigned
Status:active
Description

I would really love to display such a block on my page for nodes with the flag like, i.e. users that liked this node also liked...

Ideally, I would like to use views to do so, since I would have all options available to sort, limit, etc. the output. I have plazyed around with views for quite some time now but could not find a solution for this...

Any hints, tips? This would be a killer feature!

#1

quicksketch - November 4, 2009 - 00:01

This is *almost* possible but immensely complex and doesn't quite work. Basically what you're saying is start with the current piece of content, look at users that have flagged that content, then look at other content those users have flagged and show a list of those items. That's 3-relationship (or JOIN) process.

- Make a "node" based view
- Make a relationship for the 'Flags: User's flagged content'
- Make an argument for 'Flags: Content ID' and have it supply a default value of "Node ID from URL".
- Make a second relationship for 'Flags: User', select the 'Flags: User's flagged content' relationship as the base for the join.
- Make a third relationship for 'Flags: User's flagged content' (yes the same option as the first relationship) and select the 'Flags: User' relationship as the base for the join.

So this gets you to all the right tables, but unfortunately you can't actually show the node title of other things that have been flagged. However if you add the "Flag: Flagged time" field, you can actually theme the view to show node-titles instead since you will have the NIDs available.

#2

nitram079 - November 4, 2009 - 19:34

should work, many thanks!!!!

Will give it a try and post when the results are in.

 
 

Drupal is a registered trademark of Dries Buytaert.