Publishing your Events with Views & CCK DrupalCamp LA 2010 August 7-8, 2010 John Romine /publishing-your-events-views-cck
Publishing your Events with Views & CCK Install Drupal Event content type Calendar view Event list view field_location feature
Create Database mysql> CREATE DATABASE cruller; mysql> CREATE USER IDENTIFIED BY 'password'; mysql> GRANT ALL PRIVILEGES ON cruller.* TO
Download and configure Drupal % wget projects/drupal-6.17.tar.gz % tar zxvf drupal-6.17.tar.gz % mv drupal-6.17 cruller % rm drupal-6.17.tar.gz % cd cruller/sites/default % cp default.settings.php settings.php % chmod g+w settings.php. % vi settings.php $db_url = 'mysql://
Install Drupal in English % chmod g-w settings.php.
Download contributed modules Unpack modules in sites/all/modules % drush dl cck views date calendar devel Project cck (6.x-2.7) downloaded [success] Project views (6.x-2.11) downloaded[success] Project date (6.x-2.4) downloaded [success] Project calendar (6.x-2.2) downloaded[success] Project devel (6.x-1.21) downloaded[success]
Contributed modules: CCK
Contributed modules: Date/Time
Contributed modules: Devel & Views
Date and time configuration
Date and time: Add format
Add content type: Event
Add Date: field_date
field_date: Event settings
field_date: Global settings
Add Location: field_location Added field_location, drag below Date Drag Body above Menu settings
field_location: Event settings
field_location: Global settings
Create content > Event
Home page teaser view
Enable pre-made Calendar View
Calendar view settings
Content: Date – From date Node: Type = Event
Calendar: Month view
Calendar: iCal feed
iCal feed: Add Body & Location, Exclude from display
iCal feed: Style options
iCal feed: content example LA Drupal iCal
Calendar: Upcoming Block
Calendar page: fixes
Add a new view: events
Events page
Events archive
Events: attachment
Events archive page
Theme: link field_location to map cp modules/cck/theme/content-field.tpl.php to your theme folder cp content-field.tpl.php 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') )); ?>
TODO: Improve Date display/input Date and time formats (M j, Y g:ia) Date Popup: Timepicker (jQuery) field_date: –label (display fields: inline, views label: none) –years back and forward (-100:+100) calendar view events view