Current mission: fill in OTDs. Example: Dailyjak:On This Day/March 29

This page is "edit" protected. The "autoconfirmed" right is required to "edit" this page.<ul class='mw-logevent-loglines'> <li data-mw-logid="105836" data-mw-logaction="protect/move_prot" class="mw-logline-protect"> <a href="/index.php?title=Special:Log&amp;logid=105836" title="Special:Log">21:44, 15 June 2025</a> <a href="/User:Cobblestone" class="mw-userlink" title="User:Cobblestone"><bdi>Cobblestone</bdi></a> <span class="mw-usertoollinks mw-changeslist-links"><span><a href="/User_talk:Cobblestone" class="mw-usertoollinks-talk" title="User talk:Cobblestone">talk</a></span> <span><a href="/Special:Contributions/Cobblestone" class="mw-usertoollinks-contribs" title="Special:Contributions/Cobblestone">contribs</a></span></span> moved protection settings from <a href="/index.php?title=Soyjak_Wiki:Template_manual_of_style&amp;redirect=no" class="mw-redirect" title="Soyjak Wiki:Template manual of style">Soyjak Wiki:Template manual of style</a> to <a href="/Soyjak_Wiki:Template_Manual_of_Style" title="Soyjak Wiki:Template Manual of Style">Soyjak Wiki:Template Manual of Style</a> <span class="comment">(<a href="/Soyjak_Wiki:Template_manual_of_style" class="mw-redirect" title="Soyjak Wiki:Template manual of style">Soyjak Wiki:Template manual of style</a> moved to <a href="/Soyjak_Wiki:Template_Manual_of_Style" title="Soyjak Wiki:Template Manual of Style">Soyjak Wiki:Template Manual of Style</a>: proper noun)</span> </li> </ul></ul>
This page is "move" protected. The "autoconfirmed" right is required to "move" this page.<ul class='mw-logevent-loglines'> <li data-mw-logid="105836" data-mw-logaction="protect/move_prot" class="mw-logline-protect"> <a href="/index.php?title=Special:Log&amp;logid=105836" title="Special:Log">21:44, 15 June 2025</a> <a href="/User:Cobblestone" class="mw-userlink" title="User:Cobblestone"><bdi>Cobblestone</bdi></a> <span class="mw-usertoollinks mw-changeslist-links"><span><a href="/User_talk:Cobblestone" class="mw-usertoollinks-talk" title="User talk:Cobblestone">talk</a></span> <span><a href="/Special:Contributions/Cobblestone" class="mw-usertoollinks-contribs" title="Special:Contributions/Cobblestone">contribs</a></span></span> moved protection settings from <a href="/index.php?title=Soyjak_Wiki:Template_manual_of_style&amp;redirect=no" class="mw-redirect" title="Soyjak Wiki:Template manual of style">Soyjak Wiki:Template manual of style</a> to <a href="/Soyjak_Wiki:Template_Manual_of_Style" title="Soyjak Wiki:Template Manual of Style">Soyjak Wiki:Template Manual of Style</a> <span class="comment">(<a href="/Soyjak_Wiki:Template_manual_of_style" class="mw-redirect" title="Soyjak Wiki:Template manual of style">Soyjak Wiki:Template manual of style</a> moved to <a href="/Soyjak_Wiki:Template_Manual_of_Style" title="Soyjak Wiki:Template Manual of Style">Soyjak Wiki:Template Manual of Style</a>: proper noun)</span> </li> </ul></ul>

Soyjak Wiki:Template Manual of Style

From Soyjak Wiki, the free ensoyclopedia
Jump to navigationJump to search

This page provides a set of basic pointers on the creation of templates. New users should avoid making templates because they are highly likely to be coal.

Templates are supposed to be used on multiple articles, therefore templates have a higher standard than articles.

Types of templates

See: Soyjak Wiki:Template

Usecase

This is the single most important aspect of a template. Why should your new template exist and be used? Does it justify the vertical space taken up on the article? Is there another template that already has the same purpose? You need to consider these questions before you even begin making your template, or it may be deleted.

Certain kinds of templates, like "has connections to or written by" style templates, are especially regarded as superfluous.

Code

  • Do not use inefficient code like spamming <big> multiple times instead of using font-size.
  • Use flexboxes instead of tables where possible.
  • If possible, the template should be a single cell or div that does not use rowspan in order to minimize wasted vertical space brought about by cellpadding and cellspacing and improve readability.
  • The template should have a margin of 5px auto if it is a header or footer. This is simply to match the margins of most other templates.
  • All colors should be in hexcode. For transparent colors, use 8 digit hex notation instead.
  • Add suitable categories such [[Category:Template]] to the template page itself via <noinclude>. Make sure not to leave a newline between the noinclude and the template code or it might stack up with another newline from a different template being transcluded once it is on an article and cause an irremovable space to appear between templates and article text.
  • Use template parameters and parser functions in order to make the text of the template suitably customizable.
  • Write documentation, don't be a SLF and expect others to figure out how your template works by reading the code.

Documentation Pages

Documentation is key to any well made template, they not only help others maintain your template, but also tells all the nuswa using the visual editor how to use the template, and makes editing this very wiki a pain when it isn't done.

  • Add the {{Documentation}} template wrapped in a <noinclude>, typically at the bottom.
  • Once added there's a dedicated button to [create] the documentation subpage.
  • Here you will add the <templatedata> tag, in which you can write a JSON object that describes the template and it's parameters. The object is generally structured like this:
<templatedata>
{
  "description": "A relevant description of what type of template this is.",
  "params": {
    "1": {
      "label": "Name of the parameter",
      "description": "Does a thing, makes it keyed o algo",
      "type": "string",
      "suggestedvalues": [
        "keyed",
        "o algo"
      ],
      "required": false
    }
  }
}
</templatedata>
  • Each parameter needs to have it's name be the same as it is in the template wikicode.
    • "label": Has to be set to a descriptive, user-friendly name, not just "1" like it is in the wikicode.
    • "description": Has to describe what the parameter does, and note any common pitfalls.
    • "type": Has to be set to the type of input it expects. "string" is the most common, other common types are "number", and "boolean" (true or false).
    • "required": Has to be either true or false depending on if the variable is required for the template to function properly.
    • "suggestedvalues": Optional, typically used when there are few valid inputs.
    • "example": Optional but highly encouraged, should be a valid example input to clear up any confusion in the description.

Templatestyles

<templatestyles> is an incredibly powerful tool that can be used to effectively manage and reuse your CSS code and allows for certain features like @keyframe animations and @media queries to change the layout of a template for mobile and desktop. It has some notable pitfalls that you must avoid in order to have a properly functioning template:

  • You must NEVER target html tags that aren't a child of a parent class, this will cause all of those tags to have their styling applied across the entire page.
  • Unlike some modern CSS frameworks, MediaWiki templatestyles do not feature any kind of deduplication to avoid styling clashes from reused class names. Some care has to be taken in order to not disrupt other templates that use the same class names in the same article.[a] To avoid this you can either scope all generic class names to be a child of the parent class in CSS or prefix your class names.
Bad

Good

.template-example {
  background-color: black;
}

.header {
  color: white;
}
This is bad as all templates on the page with using the class name of "header" will now be white.
.template-example {
  background-color: black;
}

.template-example .header {
  color: white;
}
This is good, now only the "header" class name that have the parent of "template-example" will be affected.
.template-example {
  background-color: black;
}

.template-example__header {
  color: white;
}
Prefixing is also acceptable.
a {
  color: red;
}
This is bad as now all links on the entire page will be red.
.template-example a {
  color: red;
}
Now only the links in the template will be red.

Guide

  • Create a page for your CSS styling, usually as a subpage of your template: i.e. Template:Example/styles.css
  • When you've written your CSS you must change the content model from CSS to Sanitized CSS.[b]
  • Add <templatestyles src="Example/styles.css"> to your template.
  • Add the {{Template styles}} with a link to the styles.css page in your Documentation for easier editing.

Visuals

  • Templates MUST be functional and aesthetically pleasing on phone screens.
  • The template should not have extremely saturated colors.
    • On hexadecimal color, consider adding to the other values to reduce saturation, or subtracting from your main (highest) color value.
  • Do not use dark fonts on dark backgrounds or light fonts on light backgrounds.
    • Otherwise it'll be hard to read.
    • If your text is hard to read, increase the contrast between text and background colors on all three values, by at least 3 levels.
  • The template should not be excessively tall or wide.
  • The template should not be overly eye-catchy or flashy to the point that it looks headache-inducing or overstimulating to look at.
  • You should not make an upgraded (aka. "worse") version of existing templates unless necessary, as it will "award" the thing it is talking about. For example, see: {{Superpedo}}
  • Use suitable padding so that template contents do not encroach upon borders.

{{HyperDoctos}} is an example of what a really bad template looks like. If you unironically make and/or use a template like this we VVILL do unspeakable things to you.

Notes

  1. The styling will be overridden by the first <templatestyles> in the article.
  2. Mediawiki is pretty strict with what it considers "sanitized" and will filter out anything it doesn't recognize, so most nufeatures from 2020 and onwards are likely to be rejected. If you need to bypass this, add it as style tags instead if applicable.
Soyjak Wiki Guides and Policies

Guides:

Manual of Style (Template Manual of Style) - Beginner's guide - About - Staff - Coal articles - Collapsing objects - Morphing objects - Random objects


Policies:
Rules - Moderation - Privacy policy - Policy - Approver policy - Copyright