Hi, and thanks for this great module.
I would like to create a view where anonymous users can view what nodes a specific user has bookmarked.
Similar to user tracker, but not the nodes the user authored but the nodes he bookmarked.
I noticed there is a argument to select "Flags 'xyz' for UID" and i tried it with this argument handling code
global $user;
// Make the first argument the current user if not already set
if (!$args[0]) {
$args[0] = $user->uid;
}
The url I set to use user/$arg/flags/xyz
where xyz is "bookmarks"
But I just cant seem to get it to work.
Please can you help. This will also be good for the bookmarks documentation, as I looked there first, it does mention this feature but no help
Thanks
Comments
Comment #1
mooffie commentedThat's right, that's the argument you should use.
You don't need to use any "argument handling code". An argument takes its input form the URL, by default, and that's fine. the UID is there in the URL.
I don't know why your view doesn't work. Please 'export' it and paste it here.
Comment #2
vlooivlerke commentedThanks
It works out of the box, I was trying to get too complicated.
To get it to work I created a view
set the page url to bookmarks/user
Page view as - teaser list
Added the argument Flags 'xyz' for UID
and that is it.
I can now view each users bookmarks at url: bookmarks/user/1 or bookmarks/user/2
Thanks this module is excellent!
Comment #3
mooffie commentedYou can set the URL to "user/$arg/bookmarks" to make it appear as a tab on the user page (you'll have to tick a checkbox or two somewhere in the 'Menu' fieldset).
Comment #4
vlooivlerke commentedThanks, that is even a better way to do it.
Comment #5
mooffie commented(I'm closing this issue. Re-open if you encounter problems.)
Comment #6
Anonymous (not verified) commentedAutomatically closed -- issue fixed for two weeks with no activity.
Comment #7
dydecker commentedHow do you accomplish this in Drupal 6? (There is no argument "Flags 'xyz' for UID" in the six version)
Comment #8
dydecker commentedComment #9
mooffie commenteddydecker, there's a 'relationships' box. Add the flag relationship, then you'll have access to the fields/argument.
Please write down any difficulties, and weird things, you encounter. We could really improve the usability of the Views support.
Comment #10
dydecker commentedThanks, moofie. My problem was I didn't notice the "Flag: User ID" relationship, which only comes up when you select "Flags: Flagged"
For posterity, here is how to create a view of a user bookmarks which all other users can see (Drupal 6).
In Views, set the page url to user/%/bookmarks
Add two relationships:
Flags: Flagged. Check "by any user"
Flags: User ID (relationship is set to "flag")
Add an Argument: User ID. Set relationship to Flag User.
Now you can view each users bookmarks at url: user/1/bookmarks, etc
Comment #11
dydecker commentedComment #12
mooffie commentedI've started a new feature request:
#294847: default view: user/%/bookmarks
Comment #13
ibexy commentedsubscribing
Comment #14
mooffie commentedibexy, are you using Drupal 5? If so, there's already a handbook page explaining this recipe:
How to setup a "bookmarks" tab on each user's profile page
I still need to write a page explaining this for Drupal 6 users. I'm marking this "to be ported".
Comment #15
mooffie commentedThere's now a version for Drupal 6 as well:
How to setup a "bookmarks" tab on each user's profile page
Comment #16
Anonymous (not verified) commentedAutomatically closed -- issue fixed for two weeks with no activity.
Comment #17
Anonymous (not verified) commentedhttp://drupal.org/project/flag_anon