Displays a calendar in iCalendar format according to a template
Compatible with DokuWiki
Frusterick Manners, Elenor of Tsort, Detritus
This plugin is unmaintained, and it's not recommended to use it or rely on it. At some point in time (which may be in the past), it will stop working or be insecure. See https://github.com/real-or-random/dokuwiki-plugin-icalevents/issues/28#issuecomment-1059750388 for details.
Many calendars can export their entries in the iCalendar (RFC 2445) format. This plugin can read such an iCalendar file (typically named *.ics
) from an URL or a mediafile and display events according to a template, e.g., as an HTML table.
This plugin is almost a complete rewrite, integrating the features of the unmaintained fork icalendar
.
The current release requires at least PHP 5.5.5 or newer.
Running older PHP versions is a security risk anyway. Even PHP 5.5 and has already reached end of life and does not receive security patches anymore since July 2016.
To use the plugin, put the following line into any page of your wiki:
{{iCalEvents>https://host/myCalendar.ics}}
You can also add parameters:
{{iCalEvents>https://host/myCalendar.ics#from=today&to=+10 days&maxNumberOfEntries=100}}
Display all events from today within the next 10 days, but at most 100 events{{iCalEvents>https://host/myCalendar.ics#to=-1 day}}
Only display events starting before todayInstead of a URL, it is also possible to specify a local media file:
{{iCalEvents>myCalendar.ics#from=today}}
Parameter | Type | Description | Default |
---|---|---|---|
to | datetime | Hide events starting after this time. Accepts values accepted by strtotime. Set this to a value far in the future if you would like all events to be displayed, e.g., +10 years . (This parameter cannot be unset. Some values is necessary to limit the displayed occurrences of infinitely recurring events.) | +30 days |
from | datetime | If present, hide events starting before this time. Accepts values accepted by strtotime. | (none) |
maxNumberOfEntries | integer | Maximal number of events to display. | (none) |
showAs | string | Select template to display events. Default templates are table , tableWithoutSummary , list . You can modify these templates and add your own in /conf/dokuwiki.php . | table |
showEndDates | boolean | Whether the end date of an event should be displayed if it is the same as the start date. | false |
sort | asc or desc or off | Whether events should be sorted chronologically ascending or descending. If set to off , sorting is disabled and the events are displayed in the order in which they appear in the input file. This is good for performance if the events are already sorted. | asc |
dformat , tformat | string | Custom date / time format to display events (as accepted by strftime). | (global default in plugin configuration) |
The plugin can be configured in the configuration manager. You can specify templates there. In a template, the following magic strings will be recognized and replaced for each event:
{summary}
: Summary{description}
: Description{location}
: Location{location_link}
: Location text with link to map service. The URL can be configured.{summary_link}
: Summary text with download link this single event.Caching of the wiki page will be disabled if one of the following conditions holds:
from
or to
parameters is a relative to the current time, e.g., +30 days
. Note that 30 days
is the default value for to
.If you need caching for performance reasons, make sure to use a fixed time range and an external URL, which can of course point to a media file your DokuWiki installation.
Even if none of the above conditions is true, it can make sense to disable caching, e.g., if a calendar at an external URL is updated often. In this case add ~~NOCACHE~~ to the page.
The following deprecated parameters are supported for backwards compatibility with older versions and compatibility with the deprecated icalendar plugin. Please use the new syntax as above.
previewDays
: If some integer n is specified, this is equivalent to to=+n days
.numberOfEntries
: Equivalent to maxNumberOfEntries
.showAsList
: If set to true, this is equivalent to showAs=list
.
Moreover, it is possible to {{iCalendar>
… instead of {{iCalEvents>
…
lib/plugins/iCalEvents
dir (new version installs into lib/plugins/icalevents
)showEndDates
, dformat
configurable via wiki page as well, not only configshowCurrentWeek
option to highlight active week in output