Jump to content

Template:Infobox: Difference between revisions

From Digital Millennium Wiki
Add formed / formed_as / renamed / dissolved with how long ago
Accept a prebuilt history panel from wrappers; document new events
Line 63: Line 63:
-->{{#if:{{{data30|}}}|{{#if:{{{label30|}}}|<div class="dm-infobox-row"><div class="dm-infobox-label">{{{label30}}}</div><div class="dm-infobox-data">{{{data30}}}</div></div>|<div class="dm-infobox-row dm-infobox-full"><div class="dm-infobox-data">{{{data30}}}</div></div>}}}}<!--
-->{{#if:{{{data30|}}}|{{#if:{{{label30|}}}|<div class="dm-infobox-row"><div class="dm-infobox-label">{{{label30}}}</div><div class="dm-infobox-data">{{{data30}}}</div></div>|<div class="dm-infobox-row dm-infobox-full"><div class="dm-infobox-data">{{{data30}}}</div></div>}}}}<!--
--></div><!--
--></div><!--
-->{{#invoke:Formation|history}}<!--
-->{{#if:{{{history|}}}|{{{history}}}|{{#invoke:Formation|history}}}}<!--
-->{{#if:{{{preceded_by|}}}{{{succeeded_by|}}}|<div class="dm-infobox-chrono">{{#if:{{{series|}}}|<div class="dm-chrono-series">{{{series}}}</div>}}<div class="dm-chrono-row">{{#if:{{{preceded_by|}}}|<div class="dm-chrono-prev"><div class="dm-chrono-label">← Preceded by</div>{{{preceded_by}}}</div>}}{{#if:{{{succeeded_by|}}}|<div class="dm-chrono-next"><div class="dm-chrono-label">Succeeded by →</div>{{{succeeded_by}}}</div>}}</div></div>}}<!--
-->{{#if:{{{preceded_by|}}}{{{succeeded_by|}}}|<div class="dm-infobox-chrono">{{#if:{{{series|}}}|<div class="dm-chrono-series">{{{series}}}</div>}}<div class="dm-chrono-row">{{#if:{{{preceded_by|}}}|<div class="dm-chrono-prev"><div class="dm-chrono-label">← Preceded by</div>{{{preceded_by}}}</div>}}{{#if:{{{succeeded_by|}}}|<div class="dm-chrono-next"><div class="dm-chrono-label">Succeeded by →</div>{{{succeeded_by}}}</div>}}</div></div>}}<!--
-->{{#if:{{{below|}}}|<div class="dm-infobox-below">{{{below}}}</div>}}</div></includeonly><noinclude>
-->{{#if:{{{below|}}}|<div class="dm-infobox-below">{{{below}}}</div>}}</div></includeonly><noinclude>
Line 128: Line 128:
* <code>formed</code> adds a dated row with how long ago it was, e.g. ''1 year, 7 months ago''. It keeps the precision you give it: <code>2025</code> shows ''about 1 year ago'', never a made-up month. The age updates by itself every day.
* <code>formed</code> adds a dated row with how long ago it was, e.g. ''1 year, 7 months ago''. It keeps the precision you give it: <code>2025</code> shows ''about 1 year ago'', never a made-up month. The age updates by itself every day.
* Add <code>formed_as</code> and <code>renamed</code> when something changed its name. The row then becomes a small '''History''' timeline: ''Formed as Example Labs'' → ''Renamed to Example Project'', each with its own date. Renames are sorted by date, so their numbers don't matter.
* Add <code>formed_as</code> and <code>renamed</code> when something changed its name. The row then becomes a small '''History''' timeline: ''Formed as Example Labs'' → ''Renamed to Example Project'', each with its own date. Renames are sorted by date, so their numbers don't matter.
* More dated events for the timeline: <code>branched</code> + <code>branched_from</code>, <code>split</code> + <code>split_into</code>, <code>merged</code> + <code>merged_with</code> or <code>merged_into</code>, <code>revived</code> + <code>revived_as</code>, and anything else with <code>event1</code> + <code>event1_date</code>. Each can be numbered (<code>split2</code>, <code>event3_date</code> ...). <code>branched_from</code> without a <code>branched</code> date means it ''started'' as a branch. See [[Template:Infobox ideology]] for an example.
* With <code>dissolved</code>, the timeline ends there and shows how long it existed.
* With <code>dissolved</code>, the timeline ends there and shows how long it existed.
* For "how long ago" in running text, use <code><nowiki>{{Ago|2025-03-14}}</nowiki></code>.
* For "how long ago" in running text, use <code><nowiki>{{Ago|2025-03-14}}</nowiki></code>.
* Images from the Gorilla icon theme are CC BY-SA 2.0 and need a credit, e.g. in <code>caption</code>.
* Images from the Gorilla icon theme are CC BY-SA 2.0 and need a credit, e.g. in <code>caption</code>.
</noinclude>
</noinclude>

Revision as of 21:08, 17 October 2026

One infobox for everything: projects, people, hardware, models, concepts. Every field is optional and empty rows are hidden.

Usage

{{Infobox
| title      =            <!-- defaults to the page name -->
| image      =            <!-- file name, without "File:" -->
| image_size =            <!-- defaults to 220px -->
| caption    =
| alt        =
| header1    =            <!-- optional section heading above row 1 -->
| label1     =
| data1      =
| label2     =
| data2      =
<!-- ... up to label30 / data30, header1 - header30 -->
| formed       =          <!-- date: 2025, 2025-03, March 2025, 2025-03-14 or 14 March 2025 -->
| formed_label =          <!-- defaults to "Formed"; e.g. Founded, Released, Born, Started -->
| formed_as    =          <!-- original name, if it started out under another one -->
| renamed      =          <!-- date of a name change -->
| renamed_to   =          <!-- new name; the last rename defaults to the title -->
| renamed2     =          <!-- further changes: renamed2 / renamed2_to, renamed3 ... -->
| dissolved    =          <!-- end date, if it no longer exists -->
| dissolved_label =       <!-- defaults to "Dissolved"; e.g. Discontinued, Died -->
| show_age     =          <!-- "no" hides the "... ago" pills -->
| series       =          <!-- optional: name of the sequence, e.g. Boris models -->
| preceded_by  =          <!-- previous item, e.g. [[Boris-1]] -->
| succeeded_by =          <!-- next item -->
| below      =            <!-- optional footer line -->
}}
  • A row shows only when its dataN is filled in.
  • dataN without labelN spans the full width.
  • headerN puts a section heading before row N. Numbers don't need to be consecutive, so you can leave gaps for rows you'll add later.
  • preceded_by / succeeded_by add a chronology panel at the bottom; either one alone is fine. series labels it.
  • formed adds a dated row with how long ago it was, e.g. 1 year, 7 months ago. It keeps the precision you give it: 2025 shows about 1 year ago, never a made-up month. The age updates by itself every day.
  • Add formed_as and renamed when something changed its name. The row then becomes a small History timeline: Formed as Example Labs → Renamed to Example Project, each with its own date. Renames are sorted by date, so their numbers don't matter.
  • More dated events for the timeline: branched + branched_from, split + split_into, merged + merged_with or merged_into, revived + revived_as, and anything else with event1 + event1_date. Each can be numbered (split2, event3_date ...). branched_from without a branched date means it started as a branch. See Template:Infobox ideology for an example.
  • With dissolved, the timeline ends there and shows how long it existed.
  • For "how long ago" in running text, use {{Ago|2025-03-14}}.
  • Images from the Gorilla icon theme are CC BY-SA 2.0 and need a credit, e.g. in caption.