Drupal Calendar

From Stadm
Jump to navigationJump to search


The calendar module is currently installed on eri7a-dev, and can be moved to any other drupal installation when necessary using the "Features" module. Below is a short guide on the structure, functionality and use of the current setup.

Location

Structure

  • Calendar view is a page with location "events_resources"
  • Resources is a view placed under "Main Page content" in the "Content" block
  1. Set to only be displayed on "events_resources/*" and "events_resources"

Advanced Information for Calendar

  • It should be noted that, to create a new calendar page or block, you must use the "Add view from template" feature rather than "Add new view," as doing the latter will produce an error and not display the calendar
  1. Once you have clicked "Add view from template," chose the "Calendar" option with the description "A calendar view of the 'field_date_time' field in the 'node' base table."
  • To filter content into the Calendar, the "Filter Criteria" in the Calendar view is used.
  1. It checks to make sure that:
    1. The content is published
    2. The type of the content is "Event"
    3. It does not contain the term "Resource" in its taxonomy
      1. This is done with the "Has taxonomy term" filter, with the "Is none of" operator.
  • The value "Content: Type" under the "Fields" heading is necessary to color-code events based on their taxonomy term. If you would like to change the taxonomy vocabulary, this item must be kept and updated to match the new terms of the vocabulary

Advanced Information for Resources Table

  • The resources table has a slightly more complicated filter than that of the calendar (filter settings are located in Structure->Views->Resources).
  1. Has taxonomy term is equal to "Resources"
  2. Start date of Resource will be filtered by the date the user selects in the year and date select boxes.
    1. "Expose this filter to visitors, to allow them to change it" must be checked for user to be able to select their month. If this checkbox is disabled, the date filter should be turned off to display all Resources.
    2. AJAX must be turned on for this to work
  • Global Text area is set to display "Resources" as a padded header above the table because the default Header styling was a little cramped. This could be accomplished by editing the stylesheet instead.

Terms/Taxonomy

  • Vocabulary: Event Type
  • Terms:
  1. ERI Meeting
  2. ERI Seminar
  3. ERI General Event
  4. General UCSB Event
  5. Resource
    1. Shows up in "Resources" block under calendar
    2. These events should contain a link to the resource in the description

To Add New Event/Resource

  • Click "Add Event" under "Administration" in Sidebar Menu
  • Enter title, description (which should include a link if possible), date (this has multiple options, and can span a range), event location, and finally category
  1. Be sure to only select "Resource" if you don't want the event to show up in the Calendar, and would instead like it to appear as a link in the table below the Calendar
  2. If item is a resource, you should input the dates that the resource will be relevant. For example, if you are posting a restaurant menu for the month of July, put 07/1/12 as the start date and 07/31/12 as the end date. If you do not want the item to expire, select today as the start date, and some time far in the future as the end date. This is a workaround, and the CMS student assistant should work to find a cleaner method of setting a non expiring resource.
  • Click "Save"

Customizations/Additions

The events and references are filtered through taxonomy terms -- in the future, it is likely new terms will be added, and ERI staff will decide to change the color scheme.

To Add New Terms

  • You can add new event types by going to Structure->Taxonomy->Event Type =>Add Terms

To Change or Add Color

  • To define the color that an Event type should show up as in the calendar, go to Structure->Views->Calendar => edit-> Format -> Settings next to Calendar Entities
  1. Scroll down to the bottom and use the color selector next to the term you have just added
  2. Click "Apply"
  3. Click "Save" at the top of the Calendar menu

Usage

  • Calendar month can be changed by clicking "Next" or "Prev" at the top right of the page above the Calendar
  • You can check resources applicable to a given month by selecting the "Year" and "Date" under the "date" heading above the table of resources. For example, if this month is July, and I want to see a menu for this month, I would select 2012 and July.

Portability Notes

  • Since there are many components necessary for this page to function, it seems like the easiest way to move the entire page to another site would be to export all of the elements as a module using the "Features" module that is on both the eri7-dev and eri7a-dev sites.
  • To create a feature, go to "Structure"->"Features" and then click the "Create Feature" tab at the top of the box that appears.
  • Below is a non-comprehensive list of all the elements that should be included when exporting the "Feature." If this is not the first time exporting the feature, check the last version name to avoid naming confusion. The Update XML field can be left blank for now.
  1. Content types
    1. Event
  2. Dependencies
    1. Block
    2. Calendar
    3. Color
    4. Chaos Tools
    5. Date
    6. Date All Day
    7. Date API
    8. Date Popup
    9. Date Repeat API
    10. Date Repeat Field
    11. Date Tools
    12. Date Views
    13. Field UI
    14. List
    15. Options
    16. Path
    17. Taxonomy
    18. Views
    19. Views UI
  3. Fields
    1. node-event-body
    2. node-event-field-date-time
    3. node-event-field-type
    4. node-event-field-location
  4. Taxonomy
    1. Event Type
  5. Views
    1. Resources
    2. calendar
  • Once the module is downloaded and installed on the desired drupal installation, events specific to the site must be added using the same content type as mentioned in this tutorial (the content type should be included when exporting the "Feature"). Also, side menu item must be added to reflect location of calendar -- this might not change, but because the module doesn't include the menu item, the new menu link must be added anyway.