Publishing your Events with Views & CCK

of 37 /37
Publishing your Events with Views & CCK DrupalCamp LA 2010 August 7-8, 2010 John Romine [email protected] http:// 2010.drupalcampla.com/ sessions/publishing-your- events-views-cck

description

Publishing your Events with Views & CCK. DrupalCamp LA 2010 August 7-8, 2010 John Romine [email protected] http://2010.drupalcampla.com/sessions/publishing-your-events-views-cck. Publishing your Events with Views & CCK. Install Drupal Event content type Calendar view Event list view - PowerPoint PPT Presentation

Transcript of Publishing your Events with Views & CCK

Page 1: Publishing your Events  with Views & CCK

Publishing your Events with Views & CCK

DrupalCamp LA 2010

August 7-8, 2010

John Romine

[email protected]

http://2010.drupalcampla.com/sessions/publishing-your-events-views-

cck

Page 2: Publishing your Events  with Views & CCK

Publishing your Events with Views & CCK

• Install Drupal

• Event content type

• Calendar view

• Event list view

• field_location

• feature

Page 3: Publishing your Events  with Views & CCK

Create Database

mysql> CREATE DATABASE cruller;

mysql> CREATE USER cruller@localhost IDENTIFIED BY 'password';

mysql> GRANT ALL PRIVILEGES ON cruller.* TO cruller@localhost;

Page 4: Publishing your Events  with Views & CCK

Download and configure Drupal

% wget http://drupal.org/files/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://

cruller:password@localhost/cruller';

Page 5: Publishing your Events  with Views & CCK

Install Drupal in English

% chmod g-w settings.php .

Page 6: Publishing your Events  with Views & CCK

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]

Page 7: Publishing your Events  with Views & CCK

Contributed modules: CCK

Page 8: Publishing your Events  with Views & CCK

Contributed modules: Date/Time

Page 9: Publishing your Events  with Views & CCK

Contributed modules: Devel & Views

Page 10: Publishing your Events  with Views & CCK

Date and time configuration

Page 11: Publishing your Events  with Views & CCK

Date and time: Add format

Page 12: Publishing your Events  with Views & CCK

Add content type: Event

Page 13: Publishing your Events  with Views & CCK

Add Date: field_date

Page 14: Publishing your Events  with Views & CCK

field_date: Event settings

Page 15: Publishing your Events  with Views & CCK

field_date: Global settings

Page 16: Publishing your Events  with Views & CCK

Add Location: field_location

• Added field_location, drag below Date• Drag Body above Menu settings

Page 17: Publishing your Events  with Views & CCK

field_location: Event settings

Page 18: Publishing your Events  with Views & CCK

field_location: Global settings

Page 19: Publishing your Events  with Views & CCK

Create content > Event

Page 20: Publishing your Events  with Views & CCK

Home page teaser view

Page 21: Publishing your Events  with Views & CCK

Enable pre-made Calendar View

Page 22: Publishing your Events  with Views & CCK

Calendar view settings

Page 23: Publishing your Events  with Views & CCK

Content: Date – From dateNode: Type = Event

Page 24: Publishing your Events  with Views & CCK

Calendar: Month view

Page 25: Publishing your Events  with Views & CCK

Calendar: iCal feed

Page 26: Publishing your Events  with Views & CCK

iCal feed: Add Body & Location,Exclude from display

Page 27: Publishing your Events  with Views & CCK

iCal feed: Style options

Page 28: Publishing your Events  with Views & CCK

iCal feed: content example

• LA Drupal iCal http://groups.drupal.org/ical/3002

Page 29: Publishing your Events  with Views & CCK

Calendar: Upcoming Block

Page 30: Publishing your Events  with Views & CCK

Calendar page: fixes

Page 31: Publishing your Events  with Views & CCK

Add a new view: events

Page 32: Publishing your Events  with Views & CCK

Events page

Page 33: Publishing your Events  with Views & CCK

Events archive

Page 34: Publishing your Events  with Views & CCK

Events: attachment

Page 35: Publishing your Events  with Views & CCK

Events archive page

Page 36: Publishing your Events  with Views & CCK

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: <?php print $item['view'] ?>• NEW: <?php print l($item['view'], http://maps.google.com',

array('query' => array('q' => $item['view']), 'attributes' => array('target' => '_blank'))); ?>

Page 37: Publishing your Events  with Views & CCK

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