[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:
- Views already provides the
node/$node-event/whosyntax, which allows us to put the tab on, e.g., event nodes only. - I've just proposed an extension #211093 to this syntax, to allow us to specify several node types. (Please lend your '+1' there ;-)
- An alternative solution: we can introduce our own '$bookmarkable' token, which serves a similar purpose. See the patch.
- 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.
| Comment | File | Size | Author |
|---|---|---|---|
| #4 | vb_tabs.diff | 6.65 KB | mooffie |
| #3 | vb_tabs.diff | 8.02 KB | mooffie |
| bookmarkable.diff | 2.99 KB | mooffie |
Comments
Comment #1
mooffie commentedI 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.
Comment #2
moshe weitzman commentedI think we should do our own tokens. the 2 proposed ones look good to me.
Comment #3
mooffie commented(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:
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...)
Comment #4
mooffie commentedRe-roll against latest source.
Comment #5
quicksketchClosing 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.