-
☆ A M B ☆
- 2,213 Posts
Quote from: ChuckTrukk at Apr 14, 2009, 12:16 PM
Quote from: AMDbuilder at Apr 13, 2009, 05:46 PM
Can you display several calendar’s events at once?
Can you have links to your site in the popups (iCal) for more information?
1. You can show multiple events at once. Each event for a day is displayed using the eachEvent.tpl file. The calendar loops through each day. If the day has at least one event, it uses the dayWithEvent.tpl template then loops through each event using the eachEvent.tpl template. If there is no event for the day, it use dayNoEvent.tpl as the template.
I think you misunderstood... If I have say 5 calenders on the gmail site it displays them all on the main calendar. If you use the iframe include you can also have this option. My question is can I have multi calendars displayed at once using this setup?
AMDbuilder
Quote from: AMDbuilder at Apr 14, 2009, 04:36 PM
If I have say 5 calenders on the gmail site it displays them all on the main calendar. My question is can I have multi calendars displayed at once using this setup?
You couldn’t previously. I updated the code this morning to allow for multiple calendars.
This looks like excellent work! Thanks for adding the multiple calendar support - that’s really handy. Is there a placeholder available for the calendar_name, so that this could be used for class="[+calendar_name+]" type stuff? This would then allow for events from different calendars to be displayed in different colours - which would be nice.
Thanks!
Dunc
-
☆ A M B ☆
- 2,213 Posts
Quote from: ChuckTrukk at Apr 15, 2009, 05:22 AM
You couldn’t previously. I updated the code this morning to allow for multiple calendars.
Great! I look forward to some testing time next week. In the mean time I second the above request as merging the calendars is half the battle if they can be merged and color coded that would be outstanding.
AMDbuilder
Added placeholders for calendar name and email. You can view the changes in the ical example.
Your snippet now requires "$emails" instead of "$email". Could you update your demo pages with the correct info? It took me a minute to realize the change. Thanks!
-
☆ A M B ☆
- 24,524 Posts
Looking at the Readme file, if you copy/pasted that code in your snippet, it’s missing a final semicolon in the include line:
$basePath = $modx->config['base_path'] . '/assets/snippets/calendar/';
include $basePath . 'calendar.inc.php'
-
☆ A M B ☆
- 24,524 Posts
Hm. I notice the first line in the included .php file is a single-line comment. I’ve gotten this error when uploading .php and .js files that were originally with windows line-endings, got unzipped on my mac, and uploaded to a unix system. The single-line comment tags, because of the non-Unix style line-endings, ended up making the entire rest of the file one big comment. My solution was to open the file in my handy-dandy programmer’s editor and convert all the line-endings to Unix line-endings and upload that.