Blog An exploration of the art and
craft of software development

Page Event Extension Released

Posted by Marty Haught on Saturday, May 03, 2008

The event extension (for RadiantCMS) that I have been talking about and working on for nearly half a year has finally been released. You can see it in action on Boulder Ruby’s calendar page. This extension has been on my list ever since I created the Boulder Ruby site in Radiant. I will also be using this on the website for my children’s school. Loren Johnson already had done an event calendar extension but it was tied to an iCal feed and this was not how I wanted to manage the events. So this event extension is all about tying one of your pages to some date and time.

I currently have the extension hosted on github. Being the first release it should be considered alpha. Over the next month I will be fixing any bugs and improving the UI. The README in the project has detailed notes on installation and usage but I’ll outline how to install and use it briefly.


NOTE: The extension is tested against 6.6 though it might work for some of the older 6 releases. I have no intention of adding support for any release prior to 6.6.

You’ll need both the Shards extension and the Calendar Date Select plugin before you can use Page Event.

You have two options for installing the extension:

1) Use git to clone the extension

git clone git:// vendor/extensions/page_event

2) Click the download button on Github to get a tarball of the extension. At that point just expand the tarball into a vendor/extensions/page_event directory of your Radiant application.

Once you have the code installed you’ll need to run the migrations and update commands. Here’s an example of those commands for the production env:

  rake production radiant:extensions:page_event:migrate
  rake radiant:extensions:page_event:update

After a restart of your server you’ll be ready to rock, event-style.


The most visible feature of the extension is the monthly calendar which will display all events for the current month. You can get this by using the <r : calendar /> tag on whatever page you want. It currently takes no options so it’s stuck displaying a single month defaulting to the current month. It does include next and previous month navigation. It also displays the title of the page (with an event) that is a url to that page as well as the time. I’m sure eventually I’ll expose more flexibility on this.

Along with the main calendar tag there are two event specific tags for displaying formatted date and time strings:

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

On the admin side, you’ll notice that all pages now have an event date field with calendar select widget next to it. This is how you set the date and time for your event. If it’s blank, the page has no event. You do need to save the page to have it take effect. You’ll also get a new tab next to pages called Page Event. There you can view a month’s view of all events in your pages.

What’s Next

I have a short road map for upcoming features and enhancements. First, I plan to get more use out of the extension on two sites of mine. Up until now it’s just been in development mode on my laptop. I’ve already noticed something tonight that will need attention. Status is ignored in the calendar tag. This means that hidden or draft events will show links in the calendar. I’ll change that to only display published events in the calendar. Second, I plan to do some refactoring and making the page event tab more attractive. It’s functional but won’t win any UI awards. :) Further down the road, I’ll be extracting the event date concept into its own model so you can create a start and end time to your event and assign it to multiple pages. I’ll also be interested in getting any feedback from others who might find this extension useful.

Feel free to watch or fork the project on github. You can also email me or the Radiant list to discuss things about the extension. Enjoy!

blog comments powered by Disqus