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

mooffie’s picture

Status: Active » Postponed (maintainer needs more info)

I noticed there is a argument to select "Flags 'xyz' for UID"

That's right, that's the argument you should use.

and i tried it with this argument handling code

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.

vlooivlerke’s picture

Thanks

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!

mooffie’s picture

Status: Postponed (maintainer needs more info) » Fixed

To get it to work I created a view
set the page url to bookmarks/user

You 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).

vlooivlerke’s picture

Status: Fixed » Postponed (maintainer needs more info)

Thanks, that is even a better way to do it.

mooffie’s picture

Status: Postponed (maintainer needs more info) » Fixed

(I'm closing this issue. Re-open if you encounter problems.)

Anonymous’s picture

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for two weeks with no activity.

dydecker’s picture

How do you accomplish this in Drupal 6? (There is no argument "Flags 'xyz' for UID" in the six version)

dydecker’s picture

Status: Closed (fixed) » Active
mooffie’s picture

dydecker, 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.

dydecker’s picture

Thanks, 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

dydecker’s picture

Status: Active » Closed (fixed)
mooffie’s picture

I've started a new feature request:

#294847: default view: user/%/bookmarks

ibexy’s picture

subscribing

mooffie’s picture

Version: 5.x-1.0-beta3 » 6.x-1.x-dev
Status: Closed (fixed) » Patch (to be ported)

ibexy, 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".

mooffie’s picture

Status: Patch (to be ported) » Fixed

There's now a version for Drupal 6 as well:

How to setup a "bookmarks" tab on each user's profile page

Anonymous’s picture

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for two weeks with no activity.

Anonymous’s picture