Templates (rev 1)

Last edited by itadmin · 6d ago
  1. Templates

Templates enable reusable content. A template is just a page in the Template: namespace.

== Creating a template

Create a page named Template:YourName. Add content like:

Hello Template:{1}, welcome to Template:{2}!

Parameters are referenced as Template:{1} (positional) or Template:{name} (named). Template:{"Template:{name}"} gives a default value when the parameter is omitted.

== Transcluding a template

Use Template:YourName to render the template with arguments.

== Examples

Infobox:

Template:Infobox

Navigation:

Template:Navbox

== Self-transclusion

A template can invoke itself, but infinite recursion is prevented (max depth 8). Circular references are detected and broken.

Categories: Documentation