Template:Calendar/event: Difference between revisions

From OpenStreetMap Wiki
Jump to navigation Jump to search
No edit summary
(File:Flag of .svg exists, throwing off the #ifexist: logic when a city, region, or country is unspecified)
Line 37: Line 37:
| {{{country<noinclude>|Antarctica</noinclude>}}}
| {{{country<noinclude>|Antarctica</noinclude>}}}
}}
}}
}}</span>{{#ifexist: Media:{{{countryemblem|Flag of {{{country|<noinclude>Antarctica</noinclude>}}}.svg}}}
}}</span>{{#ifexist: Media:{{{countryemblem|Flag of {{{country|<includeonly>-</includeonly><noinclude>Antarctica</noinclude>}}}.svg}}}
| &#32;{{SmallFlag|{{{country<noinclude>|Antarctica</noinclude>}}}|{{{countryemblem|}}}}}
| &#32;{{SmallFlag|{{{country<noinclude>|Antarctica</noinclude>}}}|{{{countryemblem|}}}}}
}}{{#ifexist: Media:{{{regionemblem|Flag of {{{region|<noinclude>British Antarctic Territory</noinclude>}}}.svg}}}
}}{{#ifexist: Media:{{{regionemblem|Flag of {{{region|<includeonly>-</includeonly><noinclude>British Antarctic Territory</noinclude>}}}.svg}}}
| &#32;{{SmallFlag|{{{region<noinclude>|British Antarctic Territory</noinclude>}}}|{{{regionemblem|}}}}}
| &#32;{{SmallFlag|{{{region<noinclude>|British Antarctic Territory</noinclude>}}}|{{{regionemblem|}}}}}
}}{{#ifexist: Media:{{{cityemblem|Flag of {{{city|<noinclude>South Pole</noinclude>}}}.svg}}}
}}{{#ifexist: Media:{{{cityemblem|Flag of {{{city|<includeonly>-</includeonly><noinclude>South Pole</noinclude>}}}.svg}}}
| &#32;{{SmallFlag|{{{city<noinclude>|South Pole</noinclude>}}}|{{{cityemblem|}}}}}
| &#32;{{SmallFlag|{{{city<noinclude>|South Pole</noinclude>}}}|{{{cityemblem|}}}}}
}}
}}

Revision as of 22:32, 27 April 2019

Mapping party 26–29 Apr.2024-04-262024-04-30 State of the Wiki [1] State of the Wiki, international wiki-fiddler convention, South Pole, British Antarctic Territory, Antarctica Antarctica British Antarctic Territory
[Edit] [Purge] Template-info.svg Template documentation

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 Sep.2019-09-062019-09-09 State Of The Map U.S. 2019 [2], Minneapolis, Minnesota, United States United States Minnesota Minneapolis
{{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 Feb.2019-02-072019-02-08 Civic Hack Night & Map Night, San José, California, United States United States California

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

Inserts a table row into the event calendar at Template:Calendar containing basic information about a single event.

Template parameters

This template prefers block formatting of parameters.

ParameterDescriptionTypeStatus
Typetype

Nature of the event

Example
mapevent
Stringrequired
Datedate

Date of a single-day event

Example
2019-04-01
Datesuggested
Start datestart

First day of a multiday event

Example
2019-03-14
Dateoptional
End dateend

Last day of a multiday event

Example
2019-04-01
Dateoptional
Major eventmajor

Is it a major event, the highlight of everyone’s year?

Booleanoptional
Namename

Name of the event

Example
State of the Map 2019
Stringrequired
Wiki pagelink

Name of the wiki page describing the event

Example
State of the Map 2019
Page namesuggested
Official websiteurl

URL of the event’s official website

Example
https://2019.stateofthemap.org/
URLsuggested
Logologo

File name of the event’s logo; must be uploaded locally or to Wikimedia Commons

Example
SotM-2019-logo.svg
Fileoptional
Descriptiondescription

Very short description of the event; use sparingly, i.e., for major events

Example
international conference
Contentoptional
Citycity

Host city or nearest city; will be linked if an article exists by this name; displays a flag if known

Example
San Francisco
Stringsuggested
City page namecitylink

Name of the host city’s WikiProject page, if it differs from the city’s name (e.g., due to disambiguation)

Example
San Francisco, California
Page nameoptional
City emblemcityemblem

File name of the host city’s flag, seal, or coat of arms; if omitted, a flag based on the city’s name will be used if available; to disable, specify “-”

Example
Wappen Basel-Stadt matt.svg
Fileoptional
Regionregion

State, province, or other subnational region hosting the event, especially if the city and country are ambiguous on their own; displays a flag or shield if known

Example
Georgia
Stringoptional
Region page nameregionlink

Name of the state, province, or other subnational region’s WikiProject page, if it differs from the region’s name

Example
Georgia (U.S. state)
Page nameoptional
Region emblemregionemblem

File name of the flag, seal, or coat of arms of the state, province, or other subnational region; if omitted, a flag based on the region’s name will be used if available; to disable, specify “-”

Example
Flag of Georgia (U.S. state).svg
Fileoptional
Countrycountry

Host country; displays a flag if known

Example
United States
Stringsuggested
Country page namecountrylink

Name of the host country’s WikiProject page, if it differs from the country’s name

Example
WikiProject Georgia Abkhazia South-Ossetia
Page nameoptional
Country emblemcountryemblem

File name of the host country’s flag, seal, or coat of arms; if omitted, a flag based on the country’s name will be used if available; to disable, specify “-”

Example
24pxlinneighborhood.png
Fileoptional