Template:Infobox place/years active: Difference between revisions
Robertbaxter (talk | contribs) (Created page with "<includeonly>{{#if:{{{1|}}} and {{{2|}}}|<tr><th scope="row">Years active</th><td>{{{1}}}–{{{2}}}</td></tr>|{{#if:{{{1|}}}|<tr><th scope="row">Opened</th><td>{{{1}}}</td></tr>|<tr><th scope="row">Closed</th><td>{{{2}}}</td></tr>}}}}</includeonly>") |
Robertbaxter (talk | contribs) No edit summary |
||
(17 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
< | <noinclude> | ||
This is a helper template for [[Template:Infobox place]], it takes a start year, end year, and status to generate one row in the infobox about the "years active." | |||
== Behavior == | |||
''The examples below are embedded in empty infoboxes for accurate table row display.'' | |||
Only if one or both of the years are provided does this template display anything. | |||
If the first year is not provided "????" displays instead (the assumption being that if years active is being displayed there is at very least a start point, even if it is not known). | |||
<pre>{{Infobox place/years active||2021|Active}}</pre> | |||
{| class="infobox" | |||
{{Infobox place/years active||2021|Active}} | |||
|} | |||
If the second year is not provided the status is checked—a place with an "Active" status displays "present"—any other status displays the provided end year or "????" if none was provided. | |||
<pre>{{Infobox place/years active|1995||Active}} | |||
{{Infobox place/years active|2004|2018|Closed}} | |||
{{Infobox place/years active|1999||Closed}} | |||
{{Infobox place/years active|2015||Unknown}}</pre> | |||
{| class="infobox" | |||
{{Infobox place/years active|1995||Active}} | |||
{{Infobox place/years active|2004|2018|Closed}} | |||
{{Infobox place/years active|1999||Closed}} | |||
{{Infobox place/years active|2015||Unknown}} | |||
|} | |||
== TemplateData == | |||
<templatedata> | |||
{ | |||
"params": { | |||
"1": { | |||
"label": "Start year", | |||
"description": "The start year for the place.", | |||
"type": "number" | |||
}, | |||
"2": { | |||
"label": "End year", | |||
"description": "The end year for the place.", | |||
"type": "number" | |||
}, | |||
"3": { | |||
"label": "Status", | |||
"description": "The status of the place.", | |||
"type": "string", | |||
"suggestedvalues": [ | |||
"Active", | |||
"Closed", | |||
"Temporarily closed", | |||
"Inactive", | |||
"Historic", | |||
"Unknown" | |||
], | |||
"required": true | |||
} | |||
}, | |||
"description": "A helper template to display the \"Years active\" row in the infobox for a place.", | |||
"format": "inline" | |||
} | |||
</templatedata> | |||
</noinclude><!-- | |||
--><includeonly>{{#if:{{{1|}}}{{{2|}}}|<tr><th>Years active</th><td>{{#if:{{{1|}}}|{{{1|}}}|????}}–{{#ifeq:{{{3|}}}|Active|present|{{#if:{{{2|}}}|{{{2|}}}|????}}}}</td></tr>|}}</includeonly> |
Latest revision as of 00:38, 17 December 2024
This is a helper template for Template:Infobox place, it takes a start year, end year, and status to generate one row in the infobox about the "years active."
Behavior
The examples below are embedded in empty infoboxes for accurate table row display.
Only if one or both of the years are provided does this template display anything.
If the first year is not provided "????" displays instead (the assumption being that if years active is being displayed there is at very least a start point, even if it is not known).
{{Infobox place/years active||2021|Active}}
Years active | ????–present |
---|---|
If the second year is not provided the status is checked—a place with an "Active" status displays "present"—any other status displays the provided end year or "????" if none was provided.
{{Infobox place/years active|1995||Active}} {{Infobox place/years active|2004|2018|Closed}} {{Infobox place/years active|1999||Closed}} {{Infobox place/years active|2015||Unknown}}
Years active | 1995–present |
---|---|
Years active | 2004–2018 |
Years active | 1999–???? |
Years active | 2015–???? |
TemplateData
A helper template to display the "Years active" row in the infobox for a place.
Parameter | Description | Type | Status | |
---|---|---|---|---|
Start year | 1 | The start year for the place. | Number | optional |
End year | 2 | The end year for the place. | Number | optional |
Status | 3 | The status of the place.
| String | required |