Calendar (Dynamic)
Use this calendar if you want to integrate your class’s Google Calendar into the website.
Directions
- Ensure there is a calendar for your course. You may reuse the previous semester’s calendar if it exists. We suggest that calendars belong to a course’s SPA. Directions for creating a new calendar here.
- In
config.yml, setgoogle_calendar_idto the calendar’s Calendar ID from the settings page. - Create a Google API Key. You may be able to reuse the previous semester’s API key if one exists.
- If there is not a Google Cloud project associated with your course, create a new project.
- Access “APIs & Services” from the left side bar.
- Click “Create credentials” -> “API key.” Set
google_api_keyinconfig.ymlto the key you obtain. - Click on the newly created key to update the settings. Rename the key to something more useful like “COURSE NAME Calendar Key.” Under “Application restrictions” choose “Websites” and add a restriction for your course website (use the single domain, e.g. “https://data8.com”). Don’t forget to click “Save.”
- Enable the Google Calendar API. Instructions here
- Create calendar events for your class using this new calendar.
- You may want to take advantage of the recurring event feature.
- View/edit event types in the
event_typessection ofconfig.yml. Your Google Calendar titles should have the appropriate prefix or suffix matching these event types. For example, if your calendar event title is “[Data 101] Lecture”,_config.ymlshould havesuffix: Lecture. If instead, your calendar event title is “Lecture - Pivots and Joins”,_config.ymlshould haveprefix: Lecture. We recommend only changingsuffix/prefixand none of the other fields.
Note: The above directions are based loosely on this which is now out of date.
Properties of event_types in config.yml
prefix/suffix: Looks at the prefix / suffix of an event and sets the styling if it finds a match (see above).background_color: Hex code for the background color.text_color: Hex code for the text color.class: Class ID of the event (e.g.cal-lecturefor lecture events).icon: Fontawesome icon placed on the event (e.g.fa-school), more can be found infontawesome/cssor by visiting fontawesome.
Note: As you update the calendar, you’ll find that some files use the phrase “fullcalendar” and some use “calendar_dynamic”. Both refer to the dynamic calendar. fullcalendar is an open source JavaScript calendar we’re using to deliver the dynamic calendar.