Wow! What an Awesome snippet!
I simply needed a quick Calendar display within MODx, but this snippet offers so much more than that!
Through the use of templates, I was quickly able to remove the "Add Events" HTML/JavaScript (until it is needed) and now I have a ready to use/navigate/style calendar!
NOTES:
- During install on MODx v0.9.6, the snippet couldn’t find the "modx_calendar" table (as it hadn’t been created). I was not too sure HOW to get this table to "create itself", maybe I missed an install step, but a quick search for "
CREATE TABLE" led me to what I was looking for. However, the create table statement I found did not work for me, I believe it was because the PRIMARY KEY reference used Quotes instead of backticks. Either way, not a big deal...I simply modified it and created the needed table.
- Next, I received an error related to the
calendar/cache folder. I ended up having to CHMOD to 777 and all was well! Calendar has been working like a charm ever since
- If you DO NOT want the calendar event handling/admin abilities, To remove the Admin JavaScript that is loaded, you will have to update the Calendar snippet:
Update to the following (Approx Line 261):
$cal->tplAdminHeaderScript = '';
Rather than overwriting the default template, I first renamed
$cal->tplAdminHeaderScript to
$cal->tplDefaultAdminHeaderScript
It would be nice if this worked as a snippet parameter, for override purposes...shouldn’t be too hard to implement.