https://github.com/jools-r/mka_ical
Publish ical calendars as event list to your website
https://github.com/jools-r/mka_ical
textpattern-plugin
Last synced: 7 days ago
JSON representation
Publish ical calendars as event list to your website
- Host: GitHub
- URL: https://github.com/jools-r/mka_ical
- Owner: jools-r
- Created: 2018-08-21T16:31:10.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2018-08-21T22:23:43.000Z (almost 8 years ago)
- Last Synced: 2026-05-04T13:47:53.214Z (3 months ago)
- Topics: textpattern-plugin
- Language: PHP
- Size: 358 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: readme.textile
Awesome Lists containing this project
README
h1. mka_ical - Help
h3. Display ical calendars as event lists
mka_ical is a Textpattern plugin for displaying events from an iCal URL (e.g. Google Calendar) or ics file using a standard or user-definable template.
It's also possible to specify a folder or a Textpattern category for images referenced in the feed. The image is drawn from the title of the event and the name of the image.
h2. Tags
h3. Tag: mka_ical
Inserts a public calendar from an ics url or file, or a googlemail account. Can be used as a standalone or as a container tag.
The following attributes are available:
*url* (string, default: "", required)
Url of the ICS file
*googlemail*
GoogleMail address. The user's public google calendar will automatically be referenced.
*limit* (int, default: @0@, optional)
Defines how many events are shown. Defaults to 0 (= all)
*pastevents* (boolean, default: @FALSE@, optional)
Display past events
*html_id* (string, default: @icalevents@, optional)
Sets the html id for the event list
*class*
Sets the CSS class for the event list
*details* (boolean, default: @TRUE@, optional)
Display the details
*cachingtime* (int, default: @30@ (minutes), optional)
Duration that local cache file persists
*form* (string, default: none, optional)
Name of txp form to use to format each event item
*fmttime* (string, default: @%H:%M@, optional)
Format string for the time
*fmtdate* (string, default: @%d.%m.%Y@, optional)
Format string for the date
*img* (boolean, default: @FALSE@)
Display an image for each date (requires following attributes)
*imgfolder* (string, default: @images@, optional)
Image folder
*defaultimg* (string, default: @none.gif@, optional)
Default image
h3. Tag: mka_if_first_event
Use as a container tag. The tag will execute the contained statements if the displayed event is the _first_ in the currently displayed calendar.
h3. Tag: mka_if_last_event
Use as a container tag. The tag will execute the contained statements if the displayed event is the _last_ in the currently displayed calendar.
h3. Tag: mka_if_different
Use as a container tag. The tag will execute the contained statements when the value of the contained statement differs from the preceding value for that contained statement.
If additionally processing the @{placeholder}@ values, e.g. with mka_format_date, set the @key@ attribute to a name of your choosing. See Example 4.
Attribute:
*key* (string, default: empty, optional)
A name for your if_different instance.
h3. Tag: mka_format_date
Use as a container tag around an existing date, time or datetime placeholder. The tag will reformat the date or time output according to a specified format.
Attribute:
*format* (date parameter, default: empty)
Use the date formatting parameters of "strftime":http://php.net/manual/en/function.strftime.php to define the date and/or time format.
_Note: The @fmtdate@ and @fmttime@ attributes of @mka_ical@ control how the placeholders @{start_date}@, @{end_date}@ and @{start_time}@ and @{endtime}@ are formatted for the entire calendar. This tag allows you to override the date or time format._
h2. Placeholder variables
; @{date}@
: Date (format according to "fmtdate" and "fmttime" attributes)
; @{start_datetime}@
: Start datetime in @%Y-%m-%d %H:%M@ format
; @{start_date}@
: Start date (format according to "fmtdate" attribute)
; @{start_time}@
: Start time (format according to "fmttime" attribute)
; @{end_datetime}@
: End datetime in @%Y-%m-%d %H:%M@ format
; @{end_date}@
: End date (format according to "fmtdate" attribute)
; @{end_time}@
: End time (format according to "fmttime" attribute)
; @{duration}@
: Duration (formatted as days:hours:minutes:seconds)
; @{title}@
: Title (ics summary entry)
; @{description}@
: Description
; @{location}@
: Location/venue
; @{uid}@
: Event unique ID
; @{imagesrc}@
: Link to image
; @{imageid}@
: ID# of image (when using images from categories)
h2. Examples
h3. Example 1 (using a public Google Calendar)
bc.
* *googlemail*: Your GoogleMail address or name.
h3. Example 2 (using a custom url and additional options)
bc.
* *url*: URL of a calendar file
* *pastevents*: [0,1] Show past events?
* *limit*: [0,1,2,3,4,…] Show only X events
* *img*: [0,1] Show images?
* *imgfolder*: Where are the images?
* *defaultimg*: Name of the default image
h3. Example 3 (mka_ical as a container tag)
bc..
h3. Example 4 (“Month year” headings using mka_if_different and mka_format_date)
bc..
{start_date}
{description}
h3. Standard output
bc.. {date}
{title}
{description}
h2. Changelog
* *0.7.0* – Textpattern v4.7 and php 7 compatibility (jools-r)
** Plugin cleanup and reconfiguration for rah_blobin/plugin compiler
** Inclusion of updated ical parser library (php5.6+ compatibility) in plugin
** Updated google calendar URL
** New 'mka_if_first_event' tag
** New 'mka_if_last_event' tag
** New 'mka_if_different' tag
** New 'mka_format_date' tag
** Tag registration for Txp 4.6+
** Updated help
** Additional replacement placeholders
** Attribute 'cssid' renamed to 'html_id' in line with other txp tags (cssid still accepted for now)
** New 'googlemaildomain' attribute if using just google username but need to use 'gmail' rather than 'googlemail' (default setting)
** Cached json file now located in /tmp folder (as defined in prefs), not /files
* *0.6.3* – Debug details removed (Martin Kozianka)
* *0.6.2* - Output the date with *strftime*. Resolve: error when displaying without image (Martin Kozianka)
* *0.6.1* – First public version (Martin Kozianka)
h2. Credits
This plugin was originally the work of Martin Kozianka ("kozianka.de":https://kozianka.de) and has since been updated to work with Textpattern 4.7+.
It makes use of the ICal parsing library "TKr/intouch-iCalendar":https://github.com/TKr/intouch-iCalendar which is a fork of "intouch-iCalendar":https://github.com/mfkahn/intouch-iCalendar which is in turn based on "SG-iCalendar":http://sevengoslings.net/icalendar by Morten Fangel.