[This is an offshoot of #209371, Optionally show users who've bookmarked a given node.]

Building a "Who's bookmarked this" tab is easy; however, in conditionally putting this tab on a node we need some help from Views.

Overall, there are four solutions:

  1. Views already provides the node/$node-event/who syntax, which allows us to put the tab on, e.g., event nodes only.
  2. I've just proposed an extension #211093 to this syntax, to allow us to specify several node types. (Please lend your '+1' there ;-)
  3. An alternative solution: we can introduce our own '$bookmarkable' token, which serves a similar purpose. See the patch.
  4. quicksketch envisions the following feature:
    [ x ] Show tab on node page for users who marked this content
    And there's an interesting way to solve this: besides '$bookmarkable' let's have a '$bookmarked-by-user' token too. This token will match only nodes that were bookmarked by the user browsing the page.
CommentFileSizeAuthor
#4 vb_tabs.diff6.65 KBmooffie
#3 vb_tabs.diff8.02 KBmooffie
bookmarkable.diff2.99 KBmooffie

Comments

mooffie’s picture

I should, of course, mention that the help text in that patch most of it I stolen from the Organic Groups module ;)

I'm not marking this aa "code needs review", because we need to do some brainstorming first. IIUC, we havne't actually decided yet that we go the Views way.

moshe weitzman’s picture

I think we should do our own tokens. the 2 proposed ones look good to me.

mooffie’s picture

Status: Active » Needs review
StatusFileSize
new8.02 KB

(I didn't tend to this issue sooner because I was wondering whether Views2 would support tokens and about the various bugs in Views1.)

Here's the patch. Not surprisingly, it doens't have much code. Mainly the "default view" structure.

I've just updated the How to setup a "Who's bookmarked this" tab page.

We have three tokens now:

  • $bookmarkable-nnn
  • $bookmarked-nnn
  • $selfbookmarked-nnn

They are explained in the handbook page above.

(After you 'Enable' the tab's view, remember to clear Views cache or else the tab won't appear on the node...)

mooffie’s picture

StatusFileSize
new6.65 KB

Re-roll against latest source.

quicksketch’s picture

Status: Needs review » 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.