1

I tried to create the equivalent of the RSVP module (for which no D7 version exists ...) in combination with Drupal commons. But I didn't succeed in that.

So I then decided to use the Flag module, and created a flag for Participant Flag (Participant/Maybe/No) using the answer to my question about "How to implement RSVP Functionality?".

The implementation of the Flag for this is OK, but my next question now is "How to get the exact list of Participants, with some User details?". Some of the User details I want to get included in the list are:

  • User Name
  • User Picture

Assume that user A will attended a "Sample event" and user C will not attended that event. Also assume that user B will maybe attended that event.

How to create these 3 lists, for each of the 3 flags I am using (1 flag for each of these lists):

  • Participant List
  • Not attended List
  • Maybe Attended list

Anybody any suggestions?

1

Create a head count for each flag

Refer to listing flagged content with Views for a tutorial about creating a view with flagged content.

Starting from around 6:55 (and up to around 12:05) it explains How to create a view showing flagged content. Before 6:55 it mostly shows how to create that "Sidebar" flag (skip that part if you know that already). Here are the relevant steps in it (that you want to pay special attention to):

  • Even though the video uses a "global flag", your case is NOT a global flag (i.e. each user can flag/unflag, not just a restricted list of users, such as those with "administrators" or "content editors" role).

  • The tutorial creates a view of type "block", but you probably want to create a view of type "page" (though a "block" might be sufficient also if you prefer).

  • Within the "Advanced" link of the Views UI, you must add a "relationship" (think of an SQL "join" if you're not familiar with Views). To add such relationship, enter "Flag" as the "filter" on the popup window (as shown in the video around 8:25). You'll then get a shortlist of about 7 possible relationships to select from. Your question doesn't say (yet) if the flags you use apply to "nodes" or to "users", but I'm about sure (and going to assume) you'll be using "nodes". So use Flags: node flag counter as relationship. You might possibly also be able to use the Flags: node flag relationship instead (which is NOT shown in the video here), because the Flags: node flag relationship brings in more data about the flagging event, such as "who flagged it, when, etc".

  • As shown/mentioned from around 10:20 in the video, this video is about a "global flag". If it would have been about a none-global flag, then it would count the people who have used the "flag". So with only that, you already have like a "head count" of people who have "set the flag". Something like "number of attendees" already?

  • After you finish the first view for (say) the first flag, then repeat what is above by cloning that first view into a 2nd (and 3rd) view, and then adapt the 2nd view to use the 2nd (and 3rd) flag, to build a similar list.

  • As shown/mentioned from around 11:00 in the video (up to around 12:05), if you've selected to create a view of type "block" (not a "page"), then you still have to position the block (created by the view(s)) in an appropriate theme region.

Add more details about the flagging user

Refer to Getting the flagging user into Views for a tutorial about how to add more details about the flagging user (starting from around 2:00, though the real "Views" related part starts from about 4:00). Here are the relevant steps in it (that you want to pay special attention to):

  • This is about creating a view op type "page" (not block), which is also what you probably want, in the format of a simple tabular display.
  • The "path" where this view will be shown (around 4:40), like user/%/friends, which in your case I'd suggest something to become like user/%/events.
  • The "menu tab" that will be created (around 5:10), like Friends, which in your case I'd suggest something to become like Events.
  • The 2 (not just one ...) relationships that get added here, i.e.: Flags: User Flag (around 5:40) and Flags: User, which is The user that flagged an item (around 6:55)
  • Note the "contextual filter" that gets added (around 7:40, up to around 9:00), i.e.: User: Uid. It's to answer questions like "what are the events that this user confirmed to be attending so far".
  • Starting from about 9:10, the actual user details (such as User: Name) get added.

Starting from around 9:45, you get like a summary of it all, i.e.:

  • Start from a user profile (such as user/1) and use the (new) tab Friends.
  • A recap of the "crucial part" of this view, i.e. the 2 relationships that this view is using.
  • Thanks @Pierre.Vriens..Nice Tutorial.. I refer that Video tutorial but i need to get user details like Username , user Picture just like attendance how to achieved it..is it possible? – VIVEK-MDU Aug 4 '15 at 13:10
  • Let me try this concept and update you @Pierre.Vriens. – VIVEK-MDU Aug 5 '15 at 10:07
  • Here i just want to know your opinion for this question. Kindly give some idea for this... – VIVEK-MDU Aug 12 '15 at 16:20

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.