I'd like to see a new pref for each bookmark that is 'Show users who've bookmarked when displayi ng a post'. The pref could have these choices:
- none (default)
- show on separate tab
- show at bottom of teaser and detail display
- show at bottom of detail display

I'd like to use this on event nodes on groups.drupal.org instead of signup module (which won't work with date fields yet).

Comments

quicksketch’s picture

That sounds great. As a bonus we should include a default view that displays as a block that serves this same function, so you can display it anywhere you like on node pages... actually, would it be possible to include the block and skip the "show at bottom..." options since these could be done with blocks anyway?

moshe weitzman’s picture

A default View won't work unless it depends on bio module and friends. This is a *user* list.

Shipping with a block is a great idea because it can more easily list users.

quicksketch’s picture

Oh crap you're correct. This will have to be a manual block with a theme function. Fortunately we already have an API function in views_bookmark to retrieve this list.

So I'm thinking the options should simply be a checkbox and the addition of a block.

On the views bookmark configuration:
[ x ] Show tab on node page for users who marked this content

And then on the blocks page a new block:
Bookmark: [Bookmark name] user list

Do we need the "show at bottom of teaser and detail display" option? It's a bit obscurely labeled, and it'd be possible to include it in the theme layer fairly easily by loading the block and including it that way.

moshe weitzman’s picture

we don't *need* it, but it would be nice. it is the diffeence between us doing it once or loads of people doing same thing over and over. i mentioned this because thats where signup.module shows this info for rsvp on a node ... i could deal with just detail view, and omitting teaser view.

mooffie’s picture

BTW, it's already possible, using Views, to show a "Who has bookmarked this?" tab:

  1. Give your view a node/$node/who URL, or similar, and setup Views to provide a tab.
  2. Use the 'Node: ID' argument.
  3. Add the 'Bookmark: xyz' filter and choose 'is marked by any user'
  4. Select the 'Table' or 'List' style
  5. Add only the 'Bookmark: User for xyz' field

However, Views will put this tab on every node, including nodes whose type doesn't accept bookmarks. There's a way to fix this:

Views support a 'url_token' hook that lets modules introduce arguments. For example, Organic Groups uses this hook to introduce a "$group" argument. We could introduce a "$bookmarkable" argument that would only match nodes that are of a bookmarkable type. This way our "node/$bookmarkable/who" tab would appear only on bookmarkable nodes.

On the views bookmark configuration:
[ x ] Show tab on node page for users who marked this content

Hmmm... well, yeah. There's something I want to add to Views 2 feature-list: in the same way we're allowed to provide PHP code to determine arguments, we should be able to privded PHP code to determine access rights to the view. This will enable us to implement this Show only for users who marked this content access check too.

moshe weitzman’s picture

good idea about the url_token hook. i'll try to work up a patch, if you don't beat me to it. .. ALso, there is a bug in Views that needs fixing - http://drupal.org/node/183191. Reviews welcome.

mooffie’s picture

BTW, there's one nice detail regarding this 'url_token' hook that I didn't mention --because I wanted to keep my message short:

A token may get a parameter. E.g., if we use the URL node/$node-story/who then the tab will be shown only for 'story' nodes. (It's a pity we can't specify several content types.)

I had this in mind because I thought we would use such a nifty parameter too. That is, we could use node/$bookmarkable-12/who to show the tab only on nodes that are associated with book #12.

And I now see that in your specific case, Moshe, you could simply use the URL node/$node-event/who to show this tab only on event nodes.

i'll try to work up a patch, if you don't beat me to it

Just let me know if you want me to do it. I had this on my mind for some time.

ALso, there is a bug in Views that [..]

I'll have a look at it in a day or two.

mooffie’s picture

if we use the URL node/$node-story/who then the tab will be shown only for 'story' nodes. (It's a pity we can't specify several content types.)

Hmmm. You know, this nice $node-type feature makes the $bookmarkable proposition almost unneeded. What do you think?

I'll propose a patch to Views to be able to specify more than one content types there (i.e., node/$node-story,page/who).

moshe weitzman’s picture

i'd love for you to write the patch.

moshe weitzman’s picture

yeah moofie - seems like your generous help is best used reviewing the views breadcrumb patch that karen posted and adding that multiple node type feature.

quicksketch’s picture

Wow, nice usage moofie! We could include this as a default view, but it is a bit annoying that the tab will show up for all node types, even ones that don't have that particular bookmark type. We could manually make the menu in views_bookmark_menu() and tie it to the path of a default view, but I wonder if that's getting to be too much of a pain to override or disable. An access hook in the views definition would definitely solve the problem, but is this something that we should just do manually until then?

mooffie’s picture

Assigned: Unassigned » mooffie

(I'll soon update you.)

mooffie’s picture

There are several sub-issues involved here, so I'm starting three offshoot issues so we can focus the discussion:

Issue: Conditionally putting a "Who's bookmarked this" tab on a node

Moshe wrote:

[...] and adding that multiple node type feature

Yeah, I just proposed the patch. All explained in that issue above.

[...] but it is a bit annoying that the tab will show up for all node types,

Ditto.

Another offshoot:

Issue: Allow sort by user names

And another:

Issue: Start a "tips and tricks" handbook section

quicksketch’s picture

Status: Active » Closed (fixed)

Closing the Views Bookmark queue. This module has been replaced by Flag. If interested in migrating the issue to Flag, please move this issue or open a new issue in the Flag queue.