+ All Categories
Home > Documents > Publishing your Events with Views & CCK SandCamp 2011 January 8-9, 2011 John Romine (jromine)...

Publishing your Events with Views & CCK SandCamp 2011 January 8-9, 2011 John Romine (jromine)...

Date post: 20-Dec-2015
Category:
View: 218 times
Download: 2 times
Share this document with a friend
Popular Tags:
43
Publishing your Events with Views & CCK SandCamp 2011 January 8-9, 2011 John Romine (jromine) [email protected] http://2011.sandcamp.org/ sessions/ publishing-your- events-views-cck
Transcript

Publishing your Events with Views & CCK

SandCamp 2011

January 8-9, 2011

John Romine (jromine)

[email protected]

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';

Install Drupal in English

After install, make settings.php not-writable

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

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: <?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)

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 http://groups.drupal.org/ical/1988

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– 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

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


Recommended