Help:Templates
The main templates used on the RetroTechCollection Wiki, with examples. Templates keep infoboxes, headers, notices and tables consistent from page to page. To use a template, put its name in double braces: {{Template name|parameter=value}}.
How templates work
[edit source]Transclusion
[edit source]Putting {{Template name}} on a page transcludes the template: the page shows the template's current content, and a change to the template appears on every page that uses it. Special:WhatLinksHere on a template, with "Transclusions" ticked, lists the pages that use it.
Any page can be transcluded, not only templates. {{:Page name}} shows an article, and {{RetroTechCollection:Page name}} a project page. Inside a template, text between <noinclude> tags appears only on the template page itself, and text between <includeonly> tags appears only where the template is used.
Substitution
[edit source]Writing {{subst:Template name}} copies the template's content into the page when you save it, instead of transcluding it. Later changes to the template do not affect that copy. Substitution is used for one-off messages, such as the warnings Twinkle leaves on user talk pages. Infoboxes, navboxes and notices are transcluded, not substituted.
Infoboxes
[edit source]The wiki has five infoboxes: {{Infobox computer}}, {{Infobox computer peripheral}}, {{Infobox hardware}}, {{Infobox connector}} and {{Infobox software}}. Help:Infoboxes explains which to use and lists every field each one accepts.
- {{Infobox computer}}: computers and consoles.
- {{Infobox computer peripheral}}: original-period accessories such as mice, keyboards, printers and drives.
- {{Infobox hardware}}: modern aftermarket and community hardware such as replacement boards, accelerators and protectors.
A minimal {{Infobox hardware}}:
{{Infobox hardware
| name = Device name
| image = [[File:Device name.jpg|250px]]
| caption = Device name, top side
| developer = Designer or company
| type = External over-voltage protector
| first_released = Year
| operating_voltage = +5 V DC
| application = The machines it is for
}}
Infoboxes ignore parameters they do not recognise, so check the field names.
Page headers
[edit source]CategoryHeaderBox
[edit source]{{CategoryHeaderBox}} gives category pages and help pages their header bar:
{{CategoryHeaderBox
| title = Commodore Systems
| subtitle = Maintenance and repair for Commodore computers
}}
Tables
[edit source]Data tables use the styled-table class with its TemplateStyles sheet, which handles light and dark mode. Put the TemplateStyles line once, before the first table:
<templatestyles src="Template:StyledTable/styles.css" />
{| class="wikitable styled-table"
! Column 1 !! Column 2
|-
| Item 1 || Item 2
|}
Navigation boxes
[edit source]Manufacturer navboxes go at the foot of each page in the family, collapsed:
{{Navbox-AppleVintage|state=collapsed}}
Navboxes exist for Acorn (Navbox-AcornComputers), Amstrad, Apple (Navbox-AppleVintage, Navbox-AppleVintageAccessories), Atari (Navbox-AtariVintageComputers, Navbox-AtariConsoles, Navbox-AtariPeripherals), IBM (Navbox-IBMComputers), Psion, Tandy, and several smaller makers (3DO, Coleco, Magnavox, Mattel Electronics, MSX, Panasonic, Philips, SGI, Sharp). See Special:PrefixIndex/Template:Navbox- for the full list.
Notices
[edit source]- {{Ambox}}: a message box at the top of an article.
- {{Cmbox}}: a message box on a category page.
- {{Warning}}: a warning box, used for safety notices such as mains or CRT voltage.
- {{Unverified data}}: marks a page whose component values have not yet been checked against a source.
A generic message box:
{{Ambox
| type = notice
| text = This page is still under construction.
}}
Maintenance tags
[edit source]Maintenance tags such as {{Stub}}, {{Unreferenced}}, {{Missing specs}} and {{Missing photos}} can be added by hand or with Twinkle. See RetroTechCollection:Tools for the full list.
Remove a tag once the problem it describes has been fixed, and say so in the edit summary. If you think a tag was added in error, remove it and explain why in the summary or on the talk page.
Citations
[edit source]{{Cite web}}, {{Cite book}}, {{Cite manual}}, {{Cite journal}} and {{Cite magazine}} format a reference inside <ref>...</ref>. See RetroTechCollection:Citing sources for the parameters each accepts.
Linking to a template
[edit source]{{Tl}} shows a template name as a link without using the template: {{tl|Infobox computer}} gives {{Infobox computer}}.