Training and Development for Drupal

Date + Calendar Screencast (Drupal 6)

FAIL (the browser should render some flash content, not this).

(If you are looking for Date + Calendar instructions for Drupal 7, look here.)

If you like this screencast, you can show it by pitching in to a special fundraising effort. (And here's why.)

Here is a fast screencast covering the Date and Calendar modules for Drupal 6. This recipe illustrates one way to let your users post their own events (like parties, appointments, meetups, etc) that include date information stored in a field. Then you can see how to display these dates on a traditional calendar layout with all the events sorted into the correct days.

The modules doing the heavy work are the Date module (for use with CCK) and Calendar module (for use with Views). Something to note is that the Calendar module provides a number of default views that display a calendar-style layout. While you can simply enable the view called "Calendar" and call it done, this screencast instead demonstrates the two to three different steps one would take to build a calendar-style view from scratch. I chose to do it this way to help you better understand how the all the date and calendar parts fit together.

There is an entirely different approach to making dated nodes, which uses the Event module, but that is not covered in this screencast.

To make the best use of this screencast it would be awesome to have some prior exposure to the Views and CCK modules for Drupal 6. You should also have working knowledge of Drupal including the installation of contributed modules.

If you find this helpful, drop me a note. Also, if you find anything incorrect that I may have overlooked the please let me know so I can correct it.

Comments

Thanks, that worked.

well after fighting a couple of hours with the same issue, it apperas i had to insist a little to make it happend: revert and retry several times and it will work !(?)

PHPeace!

Actualy, the same happend to me after updating both date module and calendar module...

I have been fibbling arround trying arguments and other stuff i barley understand, withou success.

Help would be very appreciated. :)

/reSet

I'm trying to upgrade a Drupal 5.x site to Drupal 6.x. The 5.x site uses Event module and a taxonomy. The views module allows for a taxonomy selection to display only those events tagged for that taxonomy term in that vocabulary.

Silly me. I can't find the control in the date_browser view that gives me the same capability of the views. Is there such a thing? Can someone clue me in, please.

Very nice tutorial here! It has been a great help.

@Rex ... yes, responding to my own post(!)

I asked before experimenting long enough.

Here's how to do it if others are experiencing the same challenge.

Define a taxonomy vocabulary: Event Types
Add some terms to the vocabulary.
Do what the tutorial says to do to set up browser views.
Add a Filter to the view. Taxonomy View
of the vocabulary Event Types "is all of" as a drop down box.

That does the trick! WooHoo!

Thank you for this screencast, Sean! It worked without problems. This is the first time I get the calendar-module run properly!
Please go on making the best Drupal-screencasts!
Michael, Salzburg/Austria

Nice work, Sean!!!

Have 2 questions:

1. How to activate the change between month, week view

2. Does anyone have a solution to the problem when you click the day on the view where there are some records and the warning comes on the top, as it was already mentioned in comments before

* warning: Attempt to assign property of non-object in C:\wamp\www\modules\calendar\theme\theme.inc on line 515.

i love it. thx bro

thanks from France for this efficient tutorial!

Hi!

Thank's for the video-tutorial, it's great. I have a
doubt, what if i need that the data to show in the
calendar is stored in a custom table in a custom
module (.install, .module)??? For example, i have 3
fields (title, init_date, end_date) and i need to show
the title in each init_date. How can i get it?

How can i get this info be set in the calendar?

Thank's again!

I honestly don't know how to key other non-date.module fields in your calendar view. I assume that the data storage is constructed the same as the date module data, then it should be easy to change some of the default arguments in the date_browser view.

For a real answer, you should open an issue on the calendar module project page: http://www.drupal.org/project/calendar

Sean, I am not sure what I did, but I have lost the previous/next links on my calendar. I Googled a ton and I can't find this issue. Any ideas?

I got the calendar up and working, but I cannot figure out how to enter an event that recurs. I have to add sessions on Monday Wednesday and Fridays that will run indefinitely. I have only been using Drupal for about a month so it is probably a noob question.

Any advice, (by author or commenter) would greatly be appreciated.

Never used it myself, but there is a module in the Date bundle called Date Repeat API. That is where I would start looking. Here's a slightly helpful link: http://drupal.org/node/295239

Great screencast! Thanks for doing this! I'm looking forward to using the calendar module with date ranges and seeing how that works out.

Thanks for this great website Sean. Keep up the good work! Do you have a donate button i can press and buy you a beer?

Just wanted to say thank you for the amazing tutorial. My group partners and I at UC Irvine are building a Drupal site for a class project and this is EXACTLY what I was looking to do. I'm brand new to Drupal and this guide was very clear in introducing me to the Calendar module. Thanks again. My colleagues and I will be back to this site often, I'm sure.

Hi Sean
Thank you for an excellent demonstration. I have worked with Drupal 6 for two months and I find it interesting, challenging, fascinating, easy and troublesome at the same time. You have to work a lot with it just to know how to make it simple. Now I am trying to find out how to publish content (pages for example) in Drupal for display in a limit of time. I would like the specific content to be published or stay visible on the site for two days, and then I would like it to disappear from the site. In the same way - for example - I would like to prepare a publication for the site today, which have to be displayed for visitors tomorrow at 12 o'clock. I have tried to find information on this specific problem but I don't know where to look. Do you have any suggestion?

Quick thoughts. You could get some of this "temporary publishing" done with two additional CCK Date fields. The first would be a start date, the second a kill date. Then you could create a view that would display a list of nodes that filtered between a date range of your choice. The filters would have to be clever.

The other thing you can look into are Actions, to automatically publish batches of nodes that were previously unpublished before a certain date. Then opposite actions to unpublish content after a certain date. I don't know how articulate you can make these.

Hey Sean,

thanks for the great tutorial.

I ran into the problem several times of a blank white page after saving changes configurations while following your instructions.

Specifically, when enabling all of the necessary modules, then clicking "Save", now my modules page doesn't load at all (view source shows that the script did not run at all).

I continued with the tutorial and everything else is great, but now I can't add new modules. Any insight as to why? Or even how I might fix it?

Thanks in advance, Andrew

For some reason when I follow your instructions I don't see a content type name "Event".

When I go to Date Import/Export and then click on the event tab it says:

"There is no event table in this database. No event import options are available"

Any ideas??

Thanks,

www.CarbonPig.com

I made my own content type called "event" while off-camera. Adding new content types is a core function and doesn't require contributed modules.

Thanks for the tutorial, worked perfectly

Hi,

Great tutorial, Sean do you or anyone know how to make users event posts only display for that user account. I suppose to make a private calendar for only the user and admin to see.

good to make appointments without showing all users all information.

Sounds like either some clever permissions settings in the user area, or some tricky work with the filter settings on the view. There are a bunch of node access modules out there that might help with this too.

Hi!
I've really appreciate this tutorial!
I've just a problem that some one else has already posted here... but I didn't understand how to fix it.
The all configuration of my calendar worked well but now when I click on a date day number on the new page I have the following message:

warning: Attempt to assign property of non-object in /home/reteital/public_html/reteitalia/sites/all/modules/calendar/theme/theme.inc on line 515.

I've already checked a few of the things recommended during the tutorial (as the php version used by the server). But I still haven't found a solution.
As you can see I'm not too expert hope here you can help me. And sorry for my "easy" English.
Thanks Pietro

It's a nice video, but in my installation an error occurred and I don't know why. I've followed the instructions with the only thing that my views module has version 2.3.
My problem is that no content type event was created. What was my mistake.
Is there anyone who can help me??
Thanks in advance.

You need to make your own content type in which to use your date field. Making new content types is a Drupal core function so I skipped over this part in the video for the sake of time.

OMG, you just saved my life.

Very helpfull tutorials.I would like to ask how i disable the authoring information:(Submitted by admin on 16. February 2009) - 19:19 from events?
Thanks in advance

To share my findings:

To turn of authoring info...

It's a global setting called "display post information on ..." in admin/build/themes/settings. I checked the checkbox for Event (which is a content type created through this tutorial) and the authoring info went away.

Hi,

I have a question for date popup.

When i click on a event in my calendar, open this the node but not a popup:(

When i activate the calendar box, the click on a event open a popup.
..but this calendar box works wrong and i need thi box not.

What must i do, to activate the popup in my calander without activate this box?

Have one a tut for this view?

thx Nash

*Wonderful* screencast. Thank you very much! I am new to drupal and I can't tell you how much this helped!

1) Any ideas on how I can change what happens when clicking on the date #?

Since our calendar may have many events for the same date, it would be nice if the calendar didn't resize to fit that row (since some rows would be huge while others would be small), but rather it just said something like "... More events >" which could link to a list view, or something. Or maybe someone else has a more elegant solution?

2) Is there a way to remove all authoring information so it doesn't show things like "Submitted by Administrator on Mon, 02/16/2009 - 3:27pm" when clicking on the event?

Thanks!
Leela
---------
FYI: When I click on a date that has an event listed it takes me to a page with this error:

warning: Attempt to assign property of non-object in /home/.../modules/calendar/theme/theme.inc on line 515.

Which corresponds to the following line of code:
$vars['node']->type = $vars['node']->node_type;

Thanks for the excellent screencast Sean.

I raised a question about making an "upcoming events" block in a previous comment. I solved the problem by building another view from scratch. Here's the recipe in case anyone is interested:

1. home> administer> site building > views
a. add view
b. view name "upcoming_event"
2. NEXT
3. Click "+" by Filters
a. Check "Node: Type"
b. Push "Add"
c. Select "Event"
d. Push "Update"
3. Click "+" by Filters
a. Check "Date: Date"
b. Push "Add"
c. Select "Date and time (the name of your cck field)"
d. (i think you don't have to do this: SELECT "AND" radio button)
e. Push "UPDATE"
f. Select "is greater than or equal to"
g. Enter "now" in the "Date default:" textbox
h. Push "Update"
4. Click "+" by fields
a. Select "Content: Date and time (the name of your cck field)"
b. Push "Add"
c. Select "None" radio button (for the date field)
d. Push "Update"
5. Click "+" by fields
a. Select "Node:title"
b. Push "Add"
c. Select "Link this field to its node" checkbox
d. Wipe out the label field (to leave blank)
e. Push "Update"
6. Select the GEAR on the right of "Fields" under "Row style" under "Basic Settings"
a. Check each of the two checkboxes "Content..." and "Node:Title"
b. Enter ":" as Separator
c. Push "Update"
7. Select "Style" under "Basic Settings"
a. Select "HTML List" radio button
b. Push "Update"
8. Select "Use pager:No" under "Basic Settings", change to mini-pager
9. Change "items per page" under "Basic Settings" to 6
10. Choose "Block" from pulldown on the left side to generate a block.
a. Push "Add Display"
11. Push "Save" to save the view
12. Home >> Administer >> Site Building >> Blocks >> List
a. Find the block you made
b. Choose right side bar
c. Hit save

Also, I found that my time events were being "corrected" so I had to rereview the video. I chose to not modify the timezone with the date field and found it was the only thing that worked.

Another thanks for this jimlyke. I left Drupal for a month and I've forgotten everything - this helped me through. And thanks to Sean too!

Hey, Jim;
Thanks for the tip. I was having a hard time thinking in Drupalese :-)

Hi!

got stuck somewhere..
in the arguments of the view, the date fields I created don't come up under the Date field(s) (as explained on minute 14:29 of the video).
as well... as explained on 13:16 I cannot see Content from the drop-down list under groups.

is it a problem o version?
cck - v 1.12.2.4
drupal - 6.9

thanks for the wonderful tutorial.

Hello Sean,

Thank you very much for this lesson. It was very usefull for me in setting up the company intranet site's calendar.

God Bless You,

Gergely
Hungary

Hi there,

Thanks for your screencast. I got my calendar up in no time!

One thing, though. How can I set it up to where I can add reoccuring events that don't happen on consecutive days - for example, a theater putting on a play for the entire month of March, but only on Friday, Saturday, Sunday?

I'm new to Drupal, so any suggestions would be great.

Thanks in advance. And I look forward to more of your screencasts!

Wonderful tutorial, echoing previous commenters. A couple of questions if I may:
(1) What software did you use to prepare the screencast?
(2) I am trying to do an "upcoming events" block using the framework you built in this tutorial. I want to filter based on events that are in the future. I tried to use a filter on the event date. I had to select a field of type "Content" using the date field you defined in the video. I applied a condition to select dates greater than now (literally upcoming). Unfortunately, all the events appear, as though the filter wasnt' even there. Any advice on how to do a correct filter?

Great video tutorials as usual. You are 1 of 3 sites that I follow that are the best on the web. Keep them coming.

Jim

Good job!!! :)
cheers!

vlad

Sean, That was a great tutorial and the fact that I can see what you are doing was awesome!!

Thanks!!!

Thanks for the tutorial!

Thank you. So easy to follow. Trying to get this to work was causing no end of frustration until I saw your screencast.

Great tutorial!

Thanks from VA.

Thanks a lot! Really appreciate this tutorial. Very useful and easy to understand.
Excellent!

Hi.. greet work and thanks from germany:)
But.. i need a little help for a error when i click on the day in the calender view.
The errors are:

* warning: Attempt to assign property of non-object in C:\wamp\www\modules\calendar\theme\theme.inc on line 515.
* warning: Attempt to assign property of non-object in C:\wamp\www\modules\calendar\theme\theme.inc on line 515.
* warning: Attempt to assign property of non-object in C:\wamp\www\modules\calendar\theme\theme.inc on line 515.

i have look in line 515 and found this entry:

$var[´node´]->type = $var[´node´]->node_typ;

*whe i make // for this line. The errors are not but empty fields in the Daylist of calendar

I use German Version of Drupal 6.3 DE

Can one help?

atm, i test my page on a full compatible Wampserver @ home

Let me know if you figure this issue out, I'm experiencing the same thing.

Post new comment

  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Lines and paragraphs break automatically.

More information about formatting options

Most Recent Screencast

See video

Support the Association