BlogMatrix
 

"Upcoming Events" Gadget

edit David P. Janes 2006-08-22 10:32 UTC add comment  ·  ·

And important new feature that will be in the official V10 release are "gadgets" (following the Microsoft terminology), which are basically the little boxes on the sidebar, selectable by the user.

On the sidebar you can see a "Upcoming Events" Gadget. This one is quite simple: it lists entries in date order that have "Event" extensions added. From a code perspective, it's quite simple to implement too since everything is retrievable and sortable using tag queries:

self.events = list(bm_disk_entry.GeneratorDB(
    folker,
    userid = self.page.page_userid,
    tags = [
        ":bundle:event",
        ":is:published",
        "|:event:when:|sort",
        "|:event:when:|ge|%04d-%02d-%02d" % tuple(time.gmtime()[:3]),
    ],
))

This is also hCalendar enabled, though some of the little details haven't been worked out yet.

Add Comment