publishing your events with 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 PresentationTRANSCRIPT
![Page 1: Publishing your Events with Views & CCK](https://reader035.vdocuments.mx/reader035/viewer/2022081514/56815a91550346895dc80530/html5/thumbnails/1.jpg)
Publishing your Events with Views & CCK
DrupalCamp LA 2010
August 7-8, 2010
John Romine
http://2010.drupalcampla.com/sessions/publishing-your-events-views-
cck
![Page 2: Publishing your Events with Views & CCK](https://reader035.vdocuments.mx/reader035/viewer/2022081514/56815a91550346895dc80530/html5/thumbnails/2.jpg)
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](https://reader035.vdocuments.mx/reader035/viewer/2022081514/56815a91550346895dc80530/html5/thumbnails/3.jpg)
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](https://reader035.vdocuments.mx/reader035/viewer/2022081514/56815a91550346895dc80530/html5/thumbnails/4.jpg)
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](https://reader035.vdocuments.mx/reader035/viewer/2022081514/56815a91550346895dc80530/html5/thumbnails/5.jpg)
Install Drupal in English
% chmod g-w settings.php .
![Page 6: Publishing your Events with Views & CCK](https://reader035.vdocuments.mx/reader035/viewer/2022081514/56815a91550346895dc80530/html5/thumbnails/6.jpg)
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](https://reader035.vdocuments.mx/reader035/viewer/2022081514/56815a91550346895dc80530/html5/thumbnails/7.jpg)
Contributed modules: CCK
![Page 8: Publishing your Events with Views & CCK](https://reader035.vdocuments.mx/reader035/viewer/2022081514/56815a91550346895dc80530/html5/thumbnails/8.jpg)
Contributed modules: Date/Time
![Page 9: Publishing your Events with Views & CCK](https://reader035.vdocuments.mx/reader035/viewer/2022081514/56815a91550346895dc80530/html5/thumbnails/9.jpg)
Contributed modules: Devel & Views
![Page 10: Publishing your Events with Views & CCK](https://reader035.vdocuments.mx/reader035/viewer/2022081514/56815a91550346895dc80530/html5/thumbnails/10.jpg)
Date and time configuration
![Page 11: Publishing your Events with Views & CCK](https://reader035.vdocuments.mx/reader035/viewer/2022081514/56815a91550346895dc80530/html5/thumbnails/11.jpg)
Date and time: Add format
![Page 12: Publishing your Events with Views & CCK](https://reader035.vdocuments.mx/reader035/viewer/2022081514/56815a91550346895dc80530/html5/thumbnails/12.jpg)
Add content type: Event
![Page 13: Publishing your Events with Views & CCK](https://reader035.vdocuments.mx/reader035/viewer/2022081514/56815a91550346895dc80530/html5/thumbnails/13.jpg)
Add Date: field_date
![Page 14: Publishing your Events with Views & CCK](https://reader035.vdocuments.mx/reader035/viewer/2022081514/56815a91550346895dc80530/html5/thumbnails/14.jpg)
field_date: Event settings
![Page 15: Publishing your Events with Views & CCK](https://reader035.vdocuments.mx/reader035/viewer/2022081514/56815a91550346895dc80530/html5/thumbnails/15.jpg)
field_date: Global settings
![Page 16: Publishing your Events with Views & CCK](https://reader035.vdocuments.mx/reader035/viewer/2022081514/56815a91550346895dc80530/html5/thumbnails/16.jpg)
Add Location: field_location
• Added field_location, drag below Date• Drag Body above Menu settings
![Page 17: Publishing your Events with Views & CCK](https://reader035.vdocuments.mx/reader035/viewer/2022081514/56815a91550346895dc80530/html5/thumbnails/17.jpg)
field_location: Event settings
![Page 18: Publishing your Events with Views & CCK](https://reader035.vdocuments.mx/reader035/viewer/2022081514/56815a91550346895dc80530/html5/thumbnails/18.jpg)
field_location: Global settings
![Page 19: Publishing your Events with Views & CCK](https://reader035.vdocuments.mx/reader035/viewer/2022081514/56815a91550346895dc80530/html5/thumbnails/19.jpg)
Create content > Event
![Page 20: Publishing your Events with Views & CCK](https://reader035.vdocuments.mx/reader035/viewer/2022081514/56815a91550346895dc80530/html5/thumbnails/20.jpg)
Home page teaser view
![Page 21: Publishing your Events with Views & CCK](https://reader035.vdocuments.mx/reader035/viewer/2022081514/56815a91550346895dc80530/html5/thumbnails/21.jpg)
Enable pre-made Calendar View
![Page 22: Publishing your Events with Views & CCK](https://reader035.vdocuments.mx/reader035/viewer/2022081514/56815a91550346895dc80530/html5/thumbnails/22.jpg)
Calendar view settings
![Page 23: Publishing your Events with Views & CCK](https://reader035.vdocuments.mx/reader035/viewer/2022081514/56815a91550346895dc80530/html5/thumbnails/23.jpg)
Content: Date – From dateNode: Type = Event
![Page 24: Publishing your Events with Views & CCK](https://reader035.vdocuments.mx/reader035/viewer/2022081514/56815a91550346895dc80530/html5/thumbnails/24.jpg)
Calendar: Month view
![Page 25: Publishing your Events with Views & CCK](https://reader035.vdocuments.mx/reader035/viewer/2022081514/56815a91550346895dc80530/html5/thumbnails/25.jpg)
Calendar: iCal feed
![Page 26: Publishing your Events with Views & CCK](https://reader035.vdocuments.mx/reader035/viewer/2022081514/56815a91550346895dc80530/html5/thumbnails/26.jpg)
iCal feed: Add Body & Location,Exclude from display
![Page 27: Publishing your Events with Views & CCK](https://reader035.vdocuments.mx/reader035/viewer/2022081514/56815a91550346895dc80530/html5/thumbnails/27.jpg)
iCal feed: Style options
![Page 28: Publishing your Events with Views & CCK](https://reader035.vdocuments.mx/reader035/viewer/2022081514/56815a91550346895dc80530/html5/thumbnails/28.jpg)
iCal feed: content example
• LA Drupal iCal http://groups.drupal.org/ical/3002
![Page 29: Publishing your Events with Views & CCK](https://reader035.vdocuments.mx/reader035/viewer/2022081514/56815a91550346895dc80530/html5/thumbnails/29.jpg)
Calendar: Upcoming Block
![Page 30: Publishing your Events with Views & CCK](https://reader035.vdocuments.mx/reader035/viewer/2022081514/56815a91550346895dc80530/html5/thumbnails/30.jpg)
Calendar page: fixes
![Page 31: Publishing your Events with Views & CCK](https://reader035.vdocuments.mx/reader035/viewer/2022081514/56815a91550346895dc80530/html5/thumbnails/31.jpg)
Add a new view: events
![Page 32: Publishing your Events with Views & CCK](https://reader035.vdocuments.mx/reader035/viewer/2022081514/56815a91550346895dc80530/html5/thumbnails/32.jpg)
Events page
![Page 33: Publishing your Events with Views & CCK](https://reader035.vdocuments.mx/reader035/viewer/2022081514/56815a91550346895dc80530/html5/thumbnails/33.jpg)
Events archive
![Page 34: Publishing your Events with Views & CCK](https://reader035.vdocuments.mx/reader035/viewer/2022081514/56815a91550346895dc80530/html5/thumbnails/34.jpg)
Events: attachment
![Page 35: Publishing your Events with Views & CCK](https://reader035.vdocuments.mx/reader035/viewer/2022081514/56815a91550346895dc80530/html5/thumbnails/35.jpg)
Events archive page
![Page 36: Publishing your Events with Views & CCK](https://reader035.vdocuments.mx/reader035/viewer/2022081514/56815a91550346895dc80530/html5/thumbnails/36.jpg)
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](https://reader035.vdocuments.mx/reader035/viewer/2022081514/56815a91550346895dc80530/html5/thumbnails/37.jpg)
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