Publishing your Events with Views & CCK SandCamp 2011 January 8-9, 2011 John Romine (jromine) publishing-your-events-views-cck
Publishing your Events with Views & CCK Agenda: Install Drupal 6.20 Add Event content type –Add Date & Location fields –Theme Location field Create Calendar view Create Event list view
Create Database mysql> CREATE DATABASE eclair; mysql> CREATE USER IDENTIFIED BY 'password'; mysql> GRANT ALL PRIVILEGES ON eclair.* TO
Download and configure Drupal Download Drupal 6.20 from drupal.org: – zip Unpack into your documentroot Go to folder: documentroot/sites/default Copy default.settings.php to settings.php Make settings.php writable Edit settings.php: –Set username, password, and databasename –$db_url 'mysql://
Install Drupal in English After install, make settings.php not-writable
Download contributed modules Unpack modules into folders under documentroot/sites/all/modules
Enable modules: CCK
Enable modules: Date/Time
Enable modules: Devel generate & Views
Timezone configuration
Date and time: Add format string
Date and time: Add format type
Date and time: Configure formats
Add content type: Event
Add Date: field_date
field_date settings
field_date Global settings
Add Location: field_location Drag Date below Title Add Location, drag below Date Drag Body below Location
field_location settings
field_location Global settings
Create content » Event
Home page teaser view
Theme field_location: link to map copy modules/cck/theme/content-field.tpl.php to your theme folder copy content-field.tpl.php to content-field-field_location.tpl.php edit content-field-field_location.tpl.php OLD: NEW: <?php print l($item['view'], ' array( 'query' => array('q' => $item['view']), 'attributes' => array('target' => '_blank') )); ?> Clear theme registry cache: –Administer » Site building » Themes –Save configuration (no changes needed)
Location: link to Google Maps
Google Maps search
Enable pre-built Calendar View
Calendar view Defaults: Updated date → From date
Change Updated date → From date, Add filter Node: Type = Event
Calendar page: fixes
Calendar: Month view
iCal feed Filters: remove Date, add Node Type = Event
iCal feed Fields: Add Body & Location, Exclude from display
iCal feed Style: Set options
iCal feed: content example San Diego iCal
Calendar: Upcoming Block
Generate content: Event nodes
Add an Events list view
Events page
Events archive
Events: attachment (ye
Events archive page
Event Calendar as a Feature Unpack in documentroot/sites/all/modules – event_calendar-6.x-1.0.tar – features-6.x-1.0.zip Enable Event_calendar module (& others) –Creates Event content type –Enables and configures Calendar view –Creates Events list view
TODO Improve Date display/input –Date and time formats (M j, Y g:ia) –Date Popup, Timepicker (jquery_ui) field_date: –label (display fields: inline, views label: none) –years back and forward (e.g., 1900:2100) in views argument