Help:Eventcalendar format

From semantic-mediawiki.org
(Redirected from Help:Eventcalendar format)
Eventcalendar format
An event calendar with different views of displaying days and events
Scenarios, examples, demos
Example: Demo:Event calendar, SMWCon Fall 2012/Calendar
Collection
Further Information
Provided by: Extension "Semantic Result Formats"
Added: 1.8.0
Removed: still supported
Requirements: none
Format name: eventcalendar
Enabled? Indicates whether the result format is enabled by default upon installation of the respective extension. Yes
Authors: James Hong Kong
Categories: time
Group: events , interaction , smwapi , ajax
Table of Contents

The result format eventcalendar makes use of the "jquery.fullcalendar" plugin to generate an event calendar with different views to choose from (see defaultview below).

Parameters[edit]

General[edit]

Parameter Type Default Description
source text empty Alternative query source
limit whole number 50 The maximum number of results to return
offset whole number 0 The offset of the first result
link text all Show values as links
sort list of texts empty Property to sort the query by
order list of texts empty Order of the query sort
headers text show Display the headers/property names
mainlabel text no The label to give to the main page name
intro text empty The text to display before the query results, if there are any
outro text empty The text to display after the query results, if there are any
searchlabel text ... further results Text for continuing the search
default text empty The text to display if there are no query results

Format specific[edit]

Parameter Type Default Description
defaultview text month The initial view when the calendar loads
views text month,basicWeek,agendaDay ⧼srf-paramdesc-calendarviews⧽
firstday text Sunday The day that each week begins
start text current The initial calendar start (date or datetime values)
legend text none Specifies the position of the legend and assigned filter options
dayview yes/no no Enable the day view by clicking the day number
class text empty Specify an additional cascading style sheet class
theme text basic Select a grid theme
clicktarget text none Define a page or query string as target when clicking on a calendar date.
includeend yes/no yes Include end date in multi-day events
Available values for the parameters listed above:
  • defaultview: month, basicweek, basicday, agendaweek, agendaday
  • firstday: Sunday, Monday, Tuesday, Wednesday, Thursday, Friday, Saturday
  • start: current, earliest, latest
  • legend: none, top, bottom, tooltip, pane
  • theme: basic, vector


  • Since the 2.5.0 release of extension "Semantic Result Formats"Provides additional formats for semantic queries the clicktarget parameter is available which allows to open a form in edit mode when clicking on an calendar day.1
  • Since the 3.2.0 release of extension "Semantic Result Formats"Provides additional formats for semantic queries the includeend parameter is available which allows for including an end date for multi-day events, aka recurring events.2

Usage[edit]

Data model[edit]

It is recommended that an event entity is represented by an subobject to allow individual events to be placed within the same page source and to separate source from data.

An event is specified as a single entity represented by a title, start date, end date (optional), color (optional), icon (optional), and/or description (optional). This data model stipulates that a subject (page) contains one event or in case it contains several events those events are represented as individual subobjects within the same page.

If you want to generate recurring events, please have a look at parser function #set recurring event.

Column 0 Column 1 Column 2 Column 3 Column 4 Column 5 Column N
Purpose Event Start date/time End date/time Icon Color Description ...
Datatype text/page date date page text text/page ...
Role data (mandatory) data (mandatory) data (optional) data (optional) data (optional) data (optional) ...
Example Lorem ipsum dolor 10 Aug 2012 06:00 10 Aug 2012 14:00 File:Event-schedule.jpg #f00, #ff0000, rgb( 255, 0, 0), or red Lorem ipsum dolor ... ...
Note Color properties should be of type text to avoid any potential issues caused by color definitions such as #ff0000

Styling[edit]

A property can describe a color or icon and be assigned to an individual event.

Icon

Icons are expected to be uploaded and available within the wiki itself. The event calendar will not make any transformations of icons and therefore any icon uploaded should have an appropriated size to enable a normal display behavior.

Properties that carry a special meaning can be variable within a query while its identifier remain fixed without the need for extra parameters (Fixed identifiers are title, icon, color) resulting in a query like

{{#ask:
 ...
 |?Has event icon=icon
 |?Has color=color
 |?Event=title
 ...
}}
Height

Minimum height is 350 px. The class only get's applied for height >= 350 px. See here.

/* Event calendar help class */ 
.smw-eventcalendar {
    width: 100%;
    height: 450px;
}
{{#ask:
 ...
 |class=smw-eventcalendar
 ...
}}

Calendar start[edit]

The parameter |start is responsible for the initial calendar start of dates shown.

"current" (default setting) determines the initial calendar start as the current year, month or day. "earliest" can be used where planned events are outside of the current month and the calendar display should reflect the earliest event within those selected events. This option allows to show events beyond the current month without having to browse its earliest entity. "latest" can be used analog but reflects the latest event.

Calendar filtering[edit]

In case the calendar uses the color option to indicate different typological content (events), a filtering option can be used to filter events through a property (location, type etc.) that is semantically linked by its color.

Calendar legend[edit]

The parameter |legend is responsible for the positioning of the portlet that is used to display the content. Available options are "top", "bottom", "tooltip", "pane" or "none".

{{#ask:
 ...
 |?Has Location
 |format=eventcalendar
 |legend=top
 ...
}}

Clicktargets[edit]

The page used with the clicktarget parameter can be any page in the wiki, e.g. clicktarget=Main_Page or clicktarget=Special:FormEdit/Event?Event[Start Date]=%clickyear%-%clickmonth%-%clickday%%clicktime%&returnto=Help:Eventcalendar%2Fformat For this example to work extension "Page Forms"Allows to create and use forms for adding and editing pages with and without semantic data must be installed, too.

User preferences[edit]

Event calendar user preferences are described here.

Examples[edit]


References

  1. ^  Semantic Result Formats: GitHub pull request gh:srf:200
  2. ^  Semantic Result Formats: GitHub pull request gh:srf:586