Template:Calendar/event/doc

From OpenStreetMap Wiki
Jump to navigation Jump to search

This template inserts a table row into {{Calendar}} containing basic information about an event.

Usage

Add this template to {{Calendar}}. Do not surround it with HTML or wikitext table syntax.

Basic usage:

{{Calendar/event
| type = <!-- see [[Template:Cal]] for valid values -->
| date = <!-- for single-day events; see [[w:mw:Help:Extension:ParserFunctions##time]] for valid formats -->
| name = 
| link = 
| url = 
| city = 
| region = 
| country = 
}}

Full usage including optional parameters:

{{Calendar/event
| type = <!-- see [[Template:Cal]] for valid values -->
| date = <!-- for single-day events; see [[w:mw:Help:Extension:ParserFunctions##time]] for valid formats -->
| start = <!-- for multiday events; see [[w:mw:Help:Extension:ParserFunctions##time]] for valid formats -->
| end = <!-- for multiday events; see [[w:mw:Help:Extension:ParserFunctions##time]] for valid formats -->
| major = <!-- yes -->
| name = 
| link = 
| url = 
| logo = 
| description = 
| city = 
| citylink = 
| region = 
| regionlink = 
| country = 
| countrylink = 
| countryemblem = 
}}

Notes:

  • Only |type = and |name = are required, but |country = and either |link = or |url = are recommended.
  • Multi-day events should be relatively short. {{Dm}} doesn't support events that last more than a year, and especially long events would monopolize the top of the calendar. For long events lasting more than a week, consider breaking it up into events for the opening and closing days.
  • Use the |major = and |logo = options sparingly. State of the Map and its spinoffs are examples of major conferences.
  • Avoid using link shorteners for the |url = parameter. The calendar may appear in e-mails; recipients may hesitate to click on a link that obscures its destination.
  • The template guesses wiki pages based on |city = and |region =. If a wiki page about a different place happens to match the specified city or region's name, use |citylink = or |regionlink = to disambiguate.
  • The template guesses a flag based on |country =. In the case of Georgia, add |countryemblem = Flag of Georgia (country) to get the flag of the country instead of the U.S. state.
  • Module:Flags/MasterData defines all the flag icons supported by {{Flags}}.

Examples

{{Calendar/event
| type = conference
| start = 2019-09-6
| end = 2019-09-8
| major = yes
| name = State Of The Map U.S. 2019
| link = State Of The Map U.S. 2019
| url = //2019.stateofthemap.us/
| city = Minneapolis
| citylink = Minneapolis, Minnesota
| region = Minnesota
| country = United States
}}
Conference 6–8 Sep2019-09-062019-09-09 State Of The Map U.S. 2019 [1], Minneapolis, Minnesota, United States
{{Calendar/event
| type = pizza
| date = 2019-02-07
| name = Civic Hack Night & Map Night
| link = 
| url = //www.meetup.com/Code-for-San-Jose/events/256761257/
| city = San José
| citylink = San José, California
| region = California
| country = United States
}}
Pizza 7 Feb2019-02-072019-02-08 Civic Hack Night & Map Night, San José, California, United States

Microformats

This template generates (invisible) microformats2 tags intended to be machine-readable and that should be parseable with external tools to generate custom calendar formats. These microformats are recognized in table rows tagged with class="h-event", not recognized elsewhere. Note that there's still no support for microformat profiles because MediaWiki does not permit inserting HTML <link> elements or rel="..." attributes (it only allows custom data-*="..." attributes), the profile is assumed to be as described in "http://microformats.org/wiki/h-event".

  • |type = generates a "p-category" property for the event.
  • |date = (or |start = and |end =) generates "dt-start" and "dt-end" properties.
  • |name =, |description =, |city =, etc. generate a <span class="p-name">...</span> element.

Implementation notes

The layout of this template is constrained by Template:Calendar as well as by the OSMBC Calendar Parser, which outputs the table included in each week's issue of weeklyOSM (preview).

OSMBC imposes a number constraints on the resulting HTML code (not on the wikitext or rendered webpage), including:

  • An event must be marked up with microformats.
  • An event's location must contain commas.
  • An event's location must appear no more than two lines below the event icon. This means there can be no more than one table cell between the type and description cells, because MediaWiki separates puts each <td> element on a separate line.
  • The line containing an event's location may not contain commas before the location. This means no image can precede the location in the same table cell, because MediaWiki includes commas in the srcset attribute of the <img> tag to supply multiple resolutions of the same image.
  • The specific categories accepted by {{Cal}} are hard-coded.
  • {{Cal|talk}} is not supported. Use {{Cal|speaking}} instead.

See also