Good Eatin’ Goal: Create an event that will be displayed on the calendar.
Additional modules needed: Event (http://drupal.org/project/event).
In order to add an event, you must first install and activate the Event module in the Module manager as shown in the following screenshot:
Activating the Event module will a create a new Event content type. There are also several settings that control how events are displayed and how time zones are handled.
Drupal will display a page similar to the following:
Before we can create an event, we must set the default time zone for the site. This is done by selecting Site configuration and then Date and time, from the Administer menu.
The Good Eatin’ restaurant is located in Colorado, so we will set the time zone to US/Mountain.
Click Save configuration to save your changes.
Enter a title and a description for the event, as shown in the following screenshot, and then set the start time and optionally the end time for the event.
Good Eatin’ Goal: Display events on the site in various formats including a block of upcoming events, a table of events, and a calendar of events.
Additional modules needed: Event (http://drupal.org/project/event).
The Event module provides several methods for allowing customers to view events. We will explore each of these in turn.
The easiest way to allow visitors to browse events is by using the event page, which is accessed by at http://yoursite.com/event. The page appears as follows:
Enter the information about the new menu item, as shown in the following screenshot, and then click Save when you are satisfied.
Set the region for the List of upcoming events to Right sidebar.
The new block will appear as follows:
The final method of displaying calendar entries is a block showing upcoming events in a calendar view. To add this block, open the Block Manager by selecting Site building and then Blocks, from the Administer menu. Set the region for Calendar to browse events to Right sidebar.
The display for the calendar will appear as follows:
You can decide which of these methods to use for your own site, based on how the user will work with your site.
Good Eatin’ Goal: Discuss how to add custom content types to the event calendar.
Additional modules needed: Event (http://drupal.org/project/event).
An easy way of adding additional content types to your existing event calendar is by modifying the content type and then setting the Event calendar options.
Open the Event calendar section and modify the options, as shown here:
If you prefer to have a calendar just for the type, you can use the Only in views for this type option.
Good Eatin’ Goal: Build events using the CCK module and the Date module, rather than the Event module, thereby giving additional control over the events.
Additional modules needed: CCK (http://drupal.org/project/cck), Date (http://drupal.org/project/date).
Depending on your site, it may be more convenient to use CCK and the Date API to build dates. This strategy also gives you additional control over what information is included in the event and in the display. In addition, all required modules should be updated more quickly after each new Drupal release. However, you will need to carry out more initial setup for events and displays if you use this strategy.
Click Add content type to begin creating your new event type. We will call this type Event CCK to avoid conflicts with the Event module, as shown below:
We will call the field event_time_cck and make the type a Datetime field so that we can enter both the day on which the event occurs and the time of day at which it starts, as shown in the following screenshot:
Enter the information for the event, as shown in the following screenshot:
Good Eatin’ Goal: Display a calendar that gives more details than a block view on a page.
Additional modules needed: Calendar (http://drupal.org/project/calendar), Views(http://drupal.org/project/views), Date API (http://drupal.org/ project/date).
Now that we can create events using CCK, we need to display them on the site. We will begin by creating a page where visitors can browse all of the upcoming events using a convenient calendar.
Drupal will display a list of all of the views that have currently been established on the site. If you scroll the list, you will see the Default Node view: calendar as shown in the following screenshot:
The default settings for the view are shown in the following screenshot. We will edit several settings for our purposes.
The first change we need to make is to create a new Filter by clicking on the + symbol next to the Filters label. Select the Node: Type filter, as shown in the following screenshot:
In most cases, you should also select the Node: published or admin filter to prevent unauthorized access to private information.
Select Content: Event Time for the new field to be added, as shown in the following screenshot:
Click Add to save the changes. You will now need to configure the display of the field.
In most cases, including this one, the defaults are acceptable. So we will just click Update to continue. You will also need to update the settings for the end time (value 2), as described above.
Drupal will display a list of parameters that you can use to customize the arguments.
We will need to change this to use our Content Event time fields, and then click Update to save the changes.
Now that our view has been completely set up, we can use it to browse our events. The calendar view, which we used as a starting point, provides several methods of displaying the content as shown below:
You may use any of these views, or you can add more views according to your site’s needs. If you do not want to use a display type, you can delete it. If you click on the Calendar Page display type and review the Page settings, you will see that a Page is provided, which can be accessed using the path http://yoursite.com/calendar. No menu is provided. You can either add a menu link here, or use the Menu Manager if desired. If you open the calendar page, the display appears as follows:
Congratulations! You have now added calendar and events to your sites. These will provide valuable ways of communicating with your customers to ensure that they keep coming back to your web site and, more importantly, to your business.
I remember deciding to pursue my first IT certification, the CompTIA A+. I had signed…
Key takeaways The transformer architecture has proved to be revolutionary in outperforming the classical RNN…
Once we learn how to deploy an Ubuntu server, how to manage users, and how…
Key-takeaways: Clean code isn’t just a nice thing to have or a luxury in software projects; it's a necessity. If we…
While developing a web application, or setting dynamic pages and meta tags we need to deal with…
Software architecture is one of the most discussed topics in the software industry today, and…