Help:Templates: Difference between revisions

From eipWiki
Jump to navigation Jump to search
Created page with "''Help:Templates'' exists to explain why your page suddenly exploded into an error message that says "template loop detected." Templates are little bits of reusable wiki code that let you drop in boxes, warnings, or sarcastic notices without retyping them every time. They are also the reason you will be awake at 3 a.m. wondering why your wiki now looks like a Dumpster fire. == What are templates? == Templates are pages in the '''Template:''' namespace that you c..."
 
mNo edit summary
 
(2 intermediate revisions by the same user not shown)
Line 1: Line 1:
''Help:Templates'' exists to explain why your page suddenly exploded into an error message that says "template loop detected." Templates are little bits of reusable wiki code that let you drop in boxes, warnings, or sarcastic notices without retyping them every time. They are also the reason you will be awake at 3 a.m. wondering why your wiki now looks like a [[Dumpster fire]].   
''Help:Templates'' exists to explain why your page suddenly exploded into an error message that says "template loop detected." Templates are little bits of reusable wiki code that let you drop in boxes, warnings, or sarcastic notices without retyping them every time. They are also the reason you will be awake at 3 a.m. wondering why your wiki now looks like a [[dumpster fire]].   


== What are templates? ==   
== What are templates? ==   
Line 19: Line 19:
== Escaping templates ==   
== Escaping templates ==   
If you ever want to show literal braces without calling a template, wrap them in <nowiki><nowiki></nowiki> tags:   
If you ever want to show literal braces without calling a template, wrap them in <nowiki><nowiki></nowiki> tags:   
<nowiki><nowiki>{{Stub}}</nowiki></nowiki> → {{Stub}}
<nowiki><nowiki>{{Stub}}</nowiki></nowiki> → <nowiki>{{Stub}}</nowiki>


== Common disasters ==   
== Common disasters ==   
Line 36: Line 36:
* [[Help:Formatting]]   
* [[Help:Formatting]]   
* [[Help:Undo]]   
* [[Help:Undo]]   
* [[Sarcastic stub]]
* [[Template:Stub]]


== References ==   
== References ==   
[1] Your wiki’s [[Special:WantedTemplates|Wanted Templates]] list, which is longer than you want to admit.   
[1] Your wiki’s [[Special:WantedTemplates|Wanted Templates]] list, which is longer than you want to admit.   
[2] Wikipedia’s template jungle, a living monument to overengineering.
[2] Wikipedia’s template jungle, a living monument to overengineering.

Latest revision as of 00:51, 28 August 2025

Help:Templates exists to explain why your page suddenly exploded into an error message that says "template loop detected." Templates are little bits of reusable wiki code that let you drop in boxes, warnings, or sarcastic notices without retyping them every time. They are also the reason you will be awake at 3 a.m. wondering why your wiki now looks like a dumpster fire.

What are templates?

Templates are pages in the Template: namespace that you call with curly braces. Example: {{Stub}}

This replaces your innocent-looking text with a giant colored box announcing that your article is incomplete, stupid, or both.

How to use them

  • To call a template: {{TemplateName}}
  • To pass a parameter: {{TemplateName|parameter=value}}
  • To break the page completely: forget the closing braces.

Examples

  • {{Stub}} → produces a stub box that nobody will ever expand.
  • {{Sarcastic-stub}} → produces a stub box that openly mocks you.
  • {{Ambox|type=notice|text=This is a box}} → produces a box which will either be useful or an eyesore depending on your CSS.

Escaping templates

If you ever want to show literal braces without calling a template, wrap them in <nowiki> tags: <nowiki>{{Stub}}</nowiki> → {{Stub}}

Common disasters

  1. Infinite loops: a template that calls itself. Congratulations, you broke the wiki.
  2. Parameter hell: {{Template|a=1|b=2|c=3|d=4}}, and then forgetting what any of those mean.
  3. Copying code from Wikipedia that relies on 15 other templates you didn’t import.
  4. Thinking you’ll “just make a small change” and ending up in Flaming piece of garbage territory.

Best practices

  • Keep them simple. Every extra line is one more opportunity for chaos.
  • Document what parameters do, or don’t, and watch the next editor cry.
  • Test your template in a sandbox before unleashing it on a live article. Or don’t, and give future readers a fun surprise.

See also

References

[1] Your wiki’s Wanted Templates list, which is longer than you want to admit. [2] Wikipedia’s template jungle, a living monument to overengineering.