1 / 43

Publishing your Events with Views & CCK

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

naeva
Download Presentation

Publishing your Events with Views & CCK

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. 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

  2. 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

  3. Create Database mysql> CREATE DATABASE eclair; mysql> CREATE USER eclair@localhost IDENTIFIED BY 'password'; mysql> GRANT ALL PRIVILEGES ON eclair.* TO eclair@localhost;

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

  5. Install Drupal in English After install, make settings.php not-writable

  6. 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

  7. Enable modules: CCK

  8. Enable modules: Date/Time

  9. Enable modules: Devel generate & Views

  10. Timezone configuration

  11. Date and time: Add format string

  12. Date and time: Add format type

  13. Date and time: Configure formats

  14. Add content type: Event

  15. Add Date: field_date

  16. field_date settings

  17. field_date Global settings

  18. Add Location: field_location • Drag Date below Title • Add Location, drag below Date • Drag Body below Location

  19. field_location settings

  20. field_location Global settings

  21. Create content » Event

  22. Home page teaser view

  23. 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)

  24. Location: link to Google Maps

  25. Google Maps search

  26. Enable pre-built Calendar View

  27. Calendar view Defaults:Updated date → From date

  28. Change Updated date → From date,Add filter Node: Type = Event

  29. Calendar page: fixes

  30. Calendar: Month view

  31. iCal feed Filters: remove Date, add Node Type = Event

  32. iCal feed Fields: Add Body & Location, Exclude from display

  33. iCal feed Style: Set options

  34. iCal feed: content example • San Diego iCal http://groups.drupal.org/ical/1988

  35. Calendar: Upcoming Block

  36. Generate content: Event nodes

  37. Add an Events list view

  38. Events page

  39. Events archive

  40. Events: attachment (ye

  41. Events archive page

  42. 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

  43. 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

More Related