View
218
Download
2
Category
Tags:
Preview:
Citation preview
Publishing your Events with Views & CCK
SandCamp 2011
January 8-9, 2011
John Romine (jromine)
jromine@gmail.com
http://2011.sandcamp.org/sessions/ 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 eclair@localhost IDENTIFIED BY 'password';
mysql> GRANT ALL PRIVILEGES ON eclair.* TO eclair@localhost;
Download and configure Drupal
• Download Drupal 6.20 from drupal.org:– http://drupal.org/files/projects/drupal-6.20.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://
eclair:password@localhost/eclair';
Download contributed modules
Unpack modules into folders under documentroot/sites/all/modules
http://drupal.org/files/projects/views-6.x-2.12.zip
http://drupal.org/files/projects/cck-6.x-2.9.zip
http://drupal.org/files/projects/date-6.x-2.4.zip
http://drupal.org/files/projects/calendar-6.x-2.2.zip
http://drupal.org/files/projects/devel-6.x-1.23.zip
Add Location: field_location
• Drag Date below Title• Add Location, drag below Date• Drag Body below Location
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: <?php print $item['view'] ?>• NEW: <?php print l($item['view'], 'http://maps.google.com', array(
'query' => array('q' => $item['view']),'attributes' => array('target' => '_blank') )); ?>
• Clear theme registry cache:– Administer » Site building » Themes– Save configuration (no changes needed)
Event Calendar as a Feature
• Unpack in documentroot/sites/all/modules– http://webfiles.uci.edu/jromine/drupal/
event_calendar-6.x-1.0.tar– http://drupal.org/files/projects/
features-6.x-1.0.zip
• Enable Event_calendar module (& others)– Creates Event content type– Enables and configures Calendar view– Creates Events list view
Recommended