Textpattern Forum

You are not logged in. Register | Login | Help

#1 2009-01-06 14:13:49

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 5,714
Website

smd_calendar: complete schedule / event / calendar / diary

People following the other thread may know I’ve mentioned (once or twice…) a new plugin. After nearly three weeks of graft and tweaking, here it is for public consumption at long last.

Download smd_calendar

With this beastie you can pretty much set up Textpattern to be a gig guide, event manager, diary/scheduling tool, calendar, and anything else you can turn your devious minds to. And there’s no hacking of TXP in site, nor any extra tables required; it all hangs together via the standard, humble Textpattern article. If you can Write it, the calendar will show it.

In short, if your implementation calls for a date/time-based widget, this plugin can probably do it.

It’s big, it’s endlessly customisable, but it can run with a bare minimum of attributes and will do something close to useful out of the box. Stick a <txp:smd_calendar /> tag on the page, write an article or two in the same section and they’ll appear on the calendar on the correct dates. Use the tag as a container to format the events with standard TXP tags like <txp:posted /> and <txp:expires />. Then flick through the manual to see what else it can do :-)

This plugin bows its head in respect to its forefather mdp_calendar, the generous contributors and beta testers who have endured almost daily updates over Christmas/New Year to make it what it is, and the Textpattern devs and community for being awesome.

Now go and make time in your diary for investigating the plugin :-) And holler here if you find anything seriously cool. Or broken.

Revision history
————————

All available versions and changes are listed here. Each entry indexes the relevant post(s) in the threads to learn about the features.

Beta

  • 21 Dec 08 | 0.1 | Initial release (sponsors only)
  • 22 Dec 08 | 0.2 | Fixed a few W3C validation issues and added more data validity checks ; attempted to address date/timezone problems (and mostly failed, so wrote about it instead) ; enhanced smd_if_cal tag to check for dates and calid ; added escape attribute to smd_cal_info tag
  • 23 Dec 08 | 0.21 | Changed isoweeks so any given text becomes the column heading ; added week attribute to all relevant tags ; added day attribute to smd_cal_info ; fixed month and year attributes so calendar navigation overrides them
  • 26 Dec 08 | 0.22 | Enhanced navclass ; added linkposted (both thanks mrdale)
  • 28 Dec 08 | 0.23 | Corrected timezone offset faux pas ; added first/last weekday recurrence and recurform (all thanks mrdale) ; fixed minical ‘today’ being wrongly set
  • 01 Jan 09 | 0.3 | Added cellform, navid, navarrow, and maintain ; added <txp:smd_article_event /> (thanks mrdale) and <txp:smd_cal_class /> ; added the standard and recurfirst event flags ; made cell/event flag distinction better (e.g. event and hols flags now occur only at the cell level) ; added ability to specify a dayformat array, added a week select list and enhanced the isoweeks attribute (thanks uli) ; fixed smd_if_cal’s flag bumbling, and added SMD_ANY test ; fixed smd_cal_info author warning and added join_prefix ; fixed dangling article after plugin terminates
  • 02 Jan 09 | 0.31 | Added omitfield and the omit cell flag (thanks woof)
  • 04 Jan 09 | 0.32 | Added now and offset to smd_cal_now ; fixed warning if no events match in smd_article_event ; fixed first/last timestamps (thanks mrdale)

Official public

  • 06 Jan 09 | 0.33 | Fixed smd_cal_class typo ; changed smd_if_cal logic to or by default (both thanks Els) ; fixed multi detection ; made yearwidth more intelligent
  • 07 Jan 09 | 0.34 | Fixed {shortyear} typo ; added {isoyear} and {shortisoyear} ; added isoyear to smd_if_cal and smd_cal_info
  • 21 Jan 09 | 0.40 | Changed section to s for smd_cal_info and enabled full field support ; improved permlink support (thanks Els) ; added extrafield and extrastrict (thanks FireFusion) ; added realname (thanks rsilletti) ; added separate {flag} replacements ; added nameval ; added support for select list prefix and suffix (thanks Uli) ; fixed frontpage behaviour and added showall (thanks rsilletti) ; fixed infinite loop when using ?month / ?year in recurring dates (thanks decoderltd)
  • 09 Feb 09 | 0.41 | Fixed doc truncation (thanks woof) ; spanned events are copyable and monthformat takes custom list of names (both thanks jakob) ; ?month/?year fixed (thanks decoderltd) ; paging toggle (thanks robhert) ; fixed trimming of classes, a rogue warning, abbr/full, and week dropdown to 53
  • 13 Mar 09 | 0.42 | fixed remap (thanks Els) ; datefields added (thanks merz1 / progre55 /woof); added date ranges (thanks woof) ; added allspanned (thanks woof) ; empty classes and class name padding fixed (thanks jakob)
  • 27 Mar 11 | 0.50 | Fixed squillions of timezone bugs and added subcats, headerform, caption, summary to smd:calendar ; permitted evid (among others) to be displayed and handled correctly ; improved Windows support for formatting strings (thanks Algaris) ; improved minical ; permitted this in stepfield ; added more replacements to cellform ; fixed smd_article_event trashing main article ; added time=“today” support
  • 30 May 11 | 0.51 | Switched header items to correct orientation (thanks Els) ; fixed missing entries for spanned events (thanks woof) ; fixed minical default rendering (thanks kevinpotts) ; improved URL structure and added MLP support (thanks Els and lonelytraveller) ; fixed posted dates in minical ; fixed extra dates when using allspanned in smd_article_event (thanks jakob) ; added date support to maintain ; added smd_event_info and smd_event_duration tags (thanks jakob) ; permitted smd_if_cal inside smd_article_event ; fixed spanned events when using datefields (thanks saccade) ; added custom field support to smd_article_event (thanks jakob)
  • 20 Jun 11 | 0.52 | Fixed class names to remove rogue space character (thanks pafruu, jakob, Els, et al for reminding me)

Last edited by Bloke (2011-06-20 22:09:14)


The smd plugin menagerie — for when you need one more gribble of power from Textpattern.

Txp Builders – finely-crafted code, design and Txp

Offline

#2 2009-01-06 16:14:52

kevinpotts
Member
From: Kansas City
Registered: 2004-12-07
Posts: 364
Website

Re: smd_calendar: complete schedule / event / calendar / diary

Incredible.

Offline

#3 2009-01-06 17:13:12

thebombsite
Plugin Author
From: Exmouth, England
Registered: 2004-08-24
Posts: 3,251
Website

Re: smd_calendar: complete schedule / event / calendar / diary

Seconded.


Stuart – The BombsiteProText ThemesTextgarden

In a Time of Universal Deceit
Telling the Truth is Revolutionary.

Offline

#4 2009-01-06 17:28:45

szac
Member
From: Detroit-ish
Registered: 2004-09-18
Posts: 50

Re: smd_calendar: complete schedule / event / calendar / diary

I’m so pumped about this… THANKS

Offline

#5 2009-01-06 22:16:09

Els
Admin
From: The Netherlands
Registered: 2004-06-06
Posts: 7,374
Website

Re: smd_calendar: complete schedule / event / calendar / diary

This plugin will keep me off the streets for a while ;) It is simply amazing!

At the moment there is one thing I can’t figure out. Yes, I’ve Read The Fabulous Manual, several times, but I don’t think it impossible that I missed a couple of things ;)
I assume that the only way to get rid of the <h4> tags around the day is to use cellform. But in a cellform I can’t use article tags. And I can’t use both form and cellform, if I try that only the cellform content is displayed. What I’m trying to do is display the day, then some article content, and wrap the entire cell content in <a> tags.

Edit: doh! Forget about that. I can’t believe that I’ve been looking at this for hours, and right after posting I suddenly get it: {day} {events} in the cellform :)

Last edited by Els (2009-01-06 22:37:24)


<txp:Els /> ;)
Tag Reference | Unexpected behaviour? Check the tag trace | Still no clue? Check the names of your custom fields

Offline

#6 2009-01-07 00:31:56

rsilletti
Moderator
From: Spokane WA
Registered: 2004-04-28
Posts: 700

Re: smd_calendar: complete schedule / event / calendar / diary

Outstanding, thanks. I’ll start investigating immediately.

Offline

#7 2009-01-07 00:41:25

coopersita
Member
Registered: 2005-09-28
Posts: 68
Website

Re: smd_calendar: complete schedule / event / calendar / diary

Is there a demo one can look at? It sounds like an awesome plugin. Thanks!

Offline

#8 2009-01-07 09:39:54

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 5,714
Website

Re: smd_calendar: complete schedule / event / calendar / diary

Els wrote:

{day} {events} in the cellform

Hi Els, glad you got it sorted. As you found out, the replacement variables are the only way to inject the contents in to the cell. It’s an unfortunate side-effect of the way the PHP calendar class that was built into mdp_calendar was implemented and was too costly (in terms of processing time) to circumvent. Besides, the class did all the hard work and I didn’t want to reinvent the biscuit :-)

But I wanted to offer the ability to build cells from scratch and the way it was written prevented me from doing that. So what I came up with was the cellform concept which is processed after all the events have been assigned. The smd_calendar tag actually runs in two phases: first it gets all the matching articles and processes any form, multiform, recurform or container, setting all the necessary event flags up. Then it generates the calendar and pops any details in, setting up the cell flags in the process.

Thus all the events are ‘pre-parsed’ by the time the calendar cells are to be drawn on the screen. This presented me with a problem and the only way I could think to get round it was to fall back on the ol’ faithful replacement tag technology. Hence {events} puts in all the pre-parsed event info from the day. Bit of a kludge, but it works!

coopersita

No demo, sorry :-( Sadly my home page doesn’t run on TXP so I couldn’t offer it that way. But…

Quick start demo

  • Install the plugin
  • Make a section called something like events
  • In your page template for that section, add <txp:smd_calendar section="events" />
  • Go and create some articles in the events section, set the dates to whenever you want those events to occur
  • View yoursite.com/events

After that it’s customisation time and for that, it’s the manual I’m afraid. The documentation is long (sorry) but the key parts are the small sections at the top on the naming convention, standard / recurring / spanned events, holidays, etc. The rest is just reference material for the (many!) plugin attributes to take you to tweaksville and beyond.


The smd plugin menagerie — for when you need one more gribble of power from Textpattern.

Txp Builders – finely-crafted code, design and Txp

Offline

#9 2009-01-07 09:59:52

kemie
Plugin Author
From: mexico<-->sweden
Registered: 2004-05-20
Posts: 491
Website

Re: smd_calendar: complete schedule / event / calendar / diary

demo! demo!


~~~~~~~~~~~~~| monolinea.com | pixilate.com | istockphoto.com/kemie |~~~~~~~~~~~~~

Offline

#10 2009-01-07 10:23:00

thebombsite
Plugin Author
From: Exmouth, England
Registered: 2004-08-24
Posts: 3,251
Website

Re: smd_calendar: complete schedule / event / calendar / diary

Well it is running here but it is only the most basic format as it is up to the theme user to decide what he/she wants to do with it.


Stuart – The BombsiteProText ThemesTextgarden

In a Time of Universal Deceit
Telling the Truth is Revolutionary.

Offline

Board footer

Powered by FluxBB