Skip to content

Parameters

Templates take parameters when they're called, and refer to them with triple braces inside the template body.

Passing parameters in

At the call siteInside the template
{{Greet|Alice|Bob}}{{{1}}} → "Alice", {{{2}}} → "Bob" (positional)
{{Infobox|title=BDO|year=2015}}{{{title}}}, {{{year}}} (named)

Positional and named parameters can be mixed in one call.

Using them, with defaults

In the template bodyMeaning
{{{title}}}Insert the value of title
{{{title|Untitled}}}…or Untitled if it wasn't supplied
{{{2|{{{1}}}}}}Default to another parameter — defaults can be nested

The _caller parameter

Every template automatically receives one extra parameter, {{{_caller}}} — the name of the template that invoked it, slugified (lowercased, non-alphanumeric characters turned into hyphens). It's handy for generating IDs that are unique per call site.

HonoWiki Engine guide