Template:AgesEras

From NPOWiki
Revision as of 03:43, 19 August 2020 by Bobogoobo (talk | contribs) (create)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Documentation [edit]

This template is used to automatically display the Ages and Eras for a page based on a set of membership date ranges.

The template uses Module:AgesEras, and the data is loaded from Module:AgesEras/list - add any new Ages/Eras or changes there.

This template is included automatically based on parameters in Template:Person infobox and Template:Officeholder infobox.

Parameters

Parameters are case sensitive and take a set of date ranges (see below).

The template can take a case-sensitive named parameter for each game that is supported. Each parameter consists of a set of date ranges during which the person in question was a member of the NPO branch in that game. You can omit the end date if the person is currently a member.

The code attempts to recognize a variety of ways to input the date ranges, but it also depends on the #time parser function. In particular, it doesn't recognize dd/mm/yy format. For clarity, it's better to spell out dates or use yyyy-mm-dd. The preferred separator between ranges is a semicolon. Whatever the formatting, be consistent, but don't use the same character to separate both ranges and the dates within them.

Mechanics

The Ages/Eras icons are displayed using the indicators system. Notably, each Age/Era will have a unique identifier that determines its order on the page, which also prevents duplicates from being shown. These identifiers are determined in the module's icon function.

The code depends on a consistent naming scheme for Age/Era icons: "<Age/Era> icon <game abbreviation> <Age/Era name>", where game abbreviation matches the parameter names above, except correctly capitalized, and Age/Era name is the short form of the name, e.g. "Prophet" for Age of the Prophet (specified in the data module). These icons are placed in Category:Ages and Eras files. Note: overall branch icons use "Era" and the name is "NPO".

The above documentation is transcluded from Template:AgesEras/doc.