Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
branch: master
Fetching contributors…

Octocat-spinner-32-eaf2f5

Cannot retrieve contributors at this time

file 83 lines (45 sloc) 3.13 kb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82
= Page Event

Created by Marty Haught, January 2008

Page Event is a simple page-based event calendar for associating time-based events with your Radiant pages. The original example was setting up meeting announcements in radiant where the meeting was a page. Having this meeting show up on a site-wide calendar and having exact information on when the meeting was taking place was important.


INSTALLATION

NOTE: This assumes you're on 0.8.1. It most likely will not be backwards compatible with older versions of Radiant. If you need to make this work with an older version then I'd suggest you look at an older version of the extension.

1) Install the Calendar Date Select plugin

# install the gem
  sudo gem install calendar_date_select

# add gem dependency to environment.rb
  config.gem "calendar_date_select"

# though optional, I recommend unpacking the gem
  rake gems:unpack

You can read more about it here:
http://code.google.com/p/calendardateselect/

2) Install the Page Event Extension

script/extension install page_event

--OR--

git clone git://github.com/mghaught/radiant-page-event.git vendor/extensions/page_event

3) run migration*

rake production radiant:extensions:page_event:migrate

4) run rake update for extension*

rake radiant:extensions:page_event:update

* Both 3 and 4 are unnecessary if you used the script/extension install command

5) Start (or restart) your server


USAGE

The extension will create a new column on the pages table to store an optional event timestamp. The admin create/edit page interface will now have an Event Date field with pop-up calendar widget that will allow you to set a date and time that represents an event. This page will now be associated with that time. Additionally, there is a page event admin tab next to pages tab that will give you a month's view of events. It also have next and previous month navigation. The current UI is basic so look forward to it being enhanced.

For displaying these events on your radiant pages you can choose from several tags. The main tag you'll use is the monthly calendar tag:

<r:events:calendar />

It will produce the current month's view with any events during the time. The calendar also has previous and next month navigation. A default set of css styles are provided in the following file:

<RADIANT_ROOT>/public/stylesheets/page_event/red/style.css

In order to make use of this stylesheet you'll need to add it to the pages that will use the calendar tag.


There are several tags that allow you to grab either the next event or a list of upcoming events.

<r:events:next>...</r:events:next>
<r:events:upcoming:each>...</r:events:upcoming:each>


When it comes to accessing a specific page's event data you can use the following tags:

<r:event>
  Date: <r:date />
  Time: <r:time />
Duration: <r:duration />
</r:event>

OR

<r:event:date />
<r:event:time />
<r:event:duration />

They will simply output the date or time, respectively, in a human formatted version. The <r:date/> and <r:time/> tags accept a format attribute that specifies a strftime pattern for formatting the date or time.
Something went wrong with that request. Please try again.