This tutorial describes how to configure the Calendar View to have an individual calendar of events for each Organic Group.
Standard Calendar and Date configuration first:
1. Install Calendar and Date modules (copy the files to the server and enable modules, setup Date default settings under Site Configure)
2. Create new CCK content type (Content Management -> Content Types -> Create new content type) and title it, for example, Event.
3. Add to this Event a new field "Event Date" (of course, you can name that field however you want) and pick the display settings for it.
4. Change the view that displays the calendar - I recommend to enable the default view "calendar" and clone it, giving it a new name, for example "calendar_custom". After that, you can disable the original "calendar" view. We will be editing the new "calendar_custom" and the original view is our fallback, in case we mess things up so badly that we need to start from scratch.
5. Edit the "calendar_custom" view:
5a. Change the Filters: add "Node - Type: Event" because we only want the Events to be displayed on the calendar.
5b. Change the Fields: add your "Event Date".
5c. Change the Arguments: edit default "Date: Date (node)", scroll down to the "Date field(s):" and pick your Event Date (Content: Event Date (field_event_date)) instead of the default "Node: Updated date".
5d. Change the Fields: now you can hide or remove the default field "Node: Updated date".
6. Enable Calendar block. You may also want to enable it only to be displayed on the group pages.
Save the settings. At this point we should have a calendar and the Event type content.
When we create an Event, it shows up on calendar in every group, no matter to which group we assigned the Event. That's why we need to modify the view to fix that.
Edit the View to show Events related to the current group only:
Edit the "calendar_custom" view we created earlier.
Add new Argument "Organic groups: Groups" (for posts) and click Add. Change:
- Action to take if argument is not present: Provide default argument
- Default argument type: Node ID from URL
You can also add:
- Validator = Group nodes
That's it!
Comments
Upcoming Events Block
I have followed this tutorial and have the Calendar showing events specific to each OG and a block which shows "Upcoming Events" specific to each OG. The Upcoming Events block ONLY shows on the OG "home page". What I haven't been able to figure out is how to get the block to display the Upcoming Events on the other OG-related pages. By modifying the view, I have been able to get the block to show ALL events, but not the events specific to the OG as it does on each OG home page.
Any suggestions?
HMahoney: I think for your
HMahoney: I think for your case above, you will need to add a views relationship.
Found a solution
Thanks for your quick reply.
I had tried a relationship with no luck. This is what worked for me:
In order to get the Event Block to show on OG “subpages”:
Edit the Argument "Organic groups: Groups" (for posts) Change:
- Action to take if argument is not present: Provide default argument
Click PHP Code radio button
Add the following code in PHP Argument Code
It worked for other blocks as well.
Audience not selected when adding an event in the specific group
Everything works fine except:
I hve 3 group each with its own calendar. When I select a group I correct view only the group calendar. When I add event using the "create event" link from the group detail block it works fine: the event is created and the correct audience is selected with the current group.
The problem is: I added the "add event" link in the calendar page view. And when, in the specific group, I add an avent using that link no group is selected in the audience checkox.
Adding event from the "create event" link give me this url: node/add/event?gids[]=14 , where 14 is the nodeId of the group
Adding event from the "add event" from the calendar page give me this url: calendar/2010-02-04/14
Any advice?
Same problem. The group
Same problem. The group context seems to be lost when using the "Add" link of the Calendar view.
JV
solution
I posted a solution:
http://drupal.org/node/1364604#comment-5342356
FYI
Your post help me resolve my issue
Thank you!
I had spent 2 weeks searching for something like this. Your post hep me resolve my issue.
You can also use the
You can also use the "Calendar page".
You have to adjust the page settings for this display:
- Path = node/%/calendar
- Menu type = Menu tab + provide a title i.e. "Calendar" and weight to make it appearing properly on the Group homepage as an additional tab
JV
Links from week numbers on left column
Thanks for those suggestions.
I am having problems with the links from the week numbers shown in the left column of the calendar page. When using a path of node/%/calendar, those links become, for example: "node/%/calendar/2011-W13", whereas the link above to switch to the Week view gets converted correctly to, for example: "content/calendar-name/calendar/2011-W10".
Do you know any way to fix the links for the week numbers, or is this a bug?
For those having trouble...
If you are having trouble with the tutorial, try this:
1. Make sure CCK (Content, Content Copy), Date/Time (Calendar, Date, Data API, Date Popup, Date Repeat API, Date Timezone, Date Tools), and Views (Views, Views Exporter, Views UI) modules are turned on. These are the ones I have turned on and will be needed for the imports to work.
2. Import this content type (Content >> Content Types >> Import)
You have now created the Event content type. Now we will create the view.
3. Go to Site Building >> Views >> Import
4. Import the following View:
Now you will have a tab that will show on each organic group that links to that group's calendar.
This adds a calendar tab for
This adds a calendar tab for every node on the site. How do isolate it to just organic groups?
This worked really well for me, thanks, but question...
I also have a global calendar for non-OG events in it. How do I get it to NOT show OG events?
I considered creating a new "Group Event" content type and restricting the views per content type, but thought there must be a better programmatic way instead of maintaining two content types.
UPDATE: I found a solution: Update the global calendar view Filters to include "Organic groups: Groups, Is Empty"
IT Sherpa: CTO, Founder, Full stack Dev, Drupal, Wordpress, more. Crushing on Angular, Node, JS & embedded C/C++.
Organizer for Drupal LA https://groups.drupal.org/la Meetup and 2016, 17, 18 LA Camps https://drupalcampla.com/
Block worked fine, but Calendar Page did not, solution:
In arguments we have:
* Date: Date (node) Content: Date (field_date) - From date
* Organic groups: Groups
Changed the Calendar Page path to:
calendar/%/%
IT Sherpa: CTO, Founder, Full stack Dev, Drupal, Wordpress, more. Crushing on Angular, Node, JS & embedded C/C++.
Organizer for Drupal LA https://groups.drupal.org/la Meetup and 2016, 17, 18 LA Camps https://drupalcampla.com/
note that your first argument
note that your first argument should be Organic Groups: Groups and second is Date (you have to rearrange them)
Also needed to
Nice to see this written up simply and so well.
To create as a Menu Tab on group home pages we had to do 2 things:
1. On the Calendar page display make path
node/%/calendar
2. On the Default display arguments change the order such that "Organic groups: Groups" is above "Date:"
It might be useful to add this to the tutorial.
Thanks,
Don't understand why new argument setting is changed
I also don't really understand why the new argument setting is changed
It seems to work just as well if the action to take is set to "Display empty text" and seems less confusing.
List of groups events in which a user is member
Hi all. I successfully created a calendar for each group. I want to ask how can i make a calendar for every user that it will show all the events from the groups the user is a member?
Calendar outside of a group
Calendar outside of a group context (the main site page for example) will show all events for the user whatever the groups they are issued from.
Is it what you are looking for?
JV
Thanks for your comment. If i
Thanks for your comment. If i understand correctly you say that a calendar outside of groups will show to each user the events from all the groups of the site. My goal is a calendar that it will show to each user only the events from the groups he is a member of. Is that possible?
No, the user will only see
No, the user will only see the events of the groups he is member of (if you properly set up OG for restricting access to non-members)
This works because the calendar view is configured as if no group argument is given (this happens if the user is not in the context of a group), all events are displayed.
JV
Thanks again for your reply.
Thanks again for your reply. Well i am a little confused because this is my first time in views and calendar and i think i didn't clarify correctly what is my goal. i want to make the following :
A user is member in both groupA and groupB. GroupA has an eventA and groupB has an eventB. Now in user profile page i want to make a calendar which will display both eventA and eventB only. Is that possible?
Also i notice that while in the calendar page of every group the group events show up in the calendar block i added in the group homepage the events don't show up. I am sorry for the mess.
So you already noticed that
So you already noticed that eventA and eventB correctly show up in the context of their group respectively and exclusively.
You want a calendar that shows a user all consolidated events from all the groups he is member of, correct? For example, if a user is member of both groups groupA and groupB, he will see and access eventA and eventB. He he was only member of groupA, he would ignore eventB, ect...
Using OG means that the user (with OG access enabled) can be in 2 basically different situation
- in the context of a given group (he is member of) - only one at a time of course - which is a bounded area where he can access the group stuff but not the stuff of other groups (regardless his other groups membership) unless a node has a shared audience for several groups
- outside the context of any group: this is the case when he browses the frontpage for example.
I am guessing that you might have used the same calendar in both situations - in which case the general calendar will not show any event because no context is provided in argument.
What was missing in the previous indications was the fact that you need 2 different calendars
- one for group context that you have to setup according these instructions
- one for the general context where you have to use the calendar view that comes with the Calendar module, working out of the box.
You may just want only one calendar showing at a time, so you can condition the general calendar block with the following code
return !(og_get_group_context());
JV
Thanks again for your heads
Thanks again for your heads up. You understood correctly what i am trying to do. So far i cloned the default calendar view and then in the defaults settings i made the settings listed in this howto so i have one calendar showing the events in every group context. Now for the calendar for general context do i have to clone again the calendar view that comes with the Calendar module? What arguments do i have to use? User idand organic groups : group?
Correct, just enable the
Correct, just enable the calendar that comes with the module and use it as is - no need to care about arguments, they are just right.
JV
Thanks again for your reply.
Thanks again for your reply. I cloned again the calendar view. Now in the /calendar page there are displayed all the node types that are created in my site. So i added a filter for node : Type = Event . Now only the nodes that are from event content type are displayed. But when i test my site with a user that is only member of groupA in the /calendar page there are displayed not only the eventA but also eventB from the groupB which he isn't member of. What i miss?
Turn on the "Organic groups
Turn on the "Organic groups access control" module and check in admin/og/og_access that Visibility of posts = " Visible only within the targeted groups".
JV
Thanks for your reply. Your
Thanks for your reply. Your suggestion is working. But i have two problems now. First how can i add a tab in the user profile page such as the howto does in the groups homepages? Second and most important to me but i think i am getting away from the scope of the conversation is that now private groups aren't showing in the /og page. How can i make private groups listed in this page with a join link so the group administrator can decide whenever a user could be a member of this group?
1) I don't see well what you
1) I don't see well what you are looking for. Personally, I activate the "my groups" block, which tells the user about which groups he is member of, and from where he can get to the chosen group. Again, I condition this block to make it appearing when not in a group to clean up the UI
2) That might be counterintuitive, but you should not set groups as "private" in order to get them listed on the /og page
- they will be still "private" in the sense that only member will have access to the group content
You only set groups to "Private" when you don't want anyone aware of the existence of these groups
JV
Well i come to a dead end. If
Well i come to a dead end. If i mark a group as private then a user who isn't member of the group can't see the group events in his calendar (my goal). On the other hand if i do this the group won't be listed in the /og page so other users can't join the group because the group is invisible.
No, a non-private group won't
No, a non-private group won't show its events for non members - only the groups name is listed (I know, this is confusing). Look at the many options to parametrize a group and try them.
JV
Thanks again for your
Thanks again for your instructions. Well i put the posts private and the groups public and it the calendars is ok. Now i have to make the groups homepage not showing to non group members. Thanks again for your guidelines.
This is not possible, a
This is not possible, a feature request is open for year, but never addressed.
Nevertheless, I don't think the offered behavior is so wrong
- if a group is "private", nobody will guess its existence, it is like a "secret group"
- if a group is not private, as you set yours, the content is not accessible to non-members, however the group is listed and its homepage can be reachable by anyone. This is quite logical as if someone wish to subscribe, he should be able to display the homepage describing what it is. The group owner would have to take this into account when describing his group.
Well, this is no longer an OG Calendar issue you might better ask your future questions in the context of the OG project by now...
http://drupal.org/project/og
JV
Well i find a workaround for
Well i find a workaround for my homepage issue. As i use a panel page to create the group homepages i added a selection rule to it :
User: OG membership Current user has "Member" membership status in "Organic Group from node" group.
Great!
Great!
JV
Drupal Calendar Implemenation with Organic Groups, Date, Views,
I think here's an another awesome tutorial in PDF format:
http://data.agaric.com/drupal-calendar-implemenation-organic-groups-date...
To download the PDF try this link:
http://data.agaric.com/sites/default/files/Groups%20Context%20&%20Breadc...
www.evagabond.me
Does anyone know how to do
Does anyone know how to do this for Drupal 7?
D7 Solution
You can find the D7 tutorial here: http://drupal.org/node/1268156
OG calendar in D7 is
OG calendar in D7 is available.
I am not sure which step you don't understand?
You can mail me. yutao.life@foxmail.com