This help page is a how-to guide. It explains concepts or processes used by the Wikipedia community. It is not one of Wikipedia's policies or guidelines, and may reflect varying levels of consensus. |
There are some advanced template coding techniques to improve the display or editing of templates in Wikipedia. There are also some tactics for debugging template parameters in the MediaWiki markup language. If there is a possibility, it is better to use lua modules.
Many bugs are associated with the difficulty in dealing with some awkward features in the markup language which lead to coding errors. Unbalanced metacharacters are a major source of errors. For example, coding {{1}}}
instead of {{{1}}}
causes it to act as if it were {{1}} }
, thereby invoking Template:1 + "}".
There are some differences of wiki-formatting of contents of parameters when inside #if-expressions, but not when outside. Templates which need to be substituted need special handling. Providing parameter defaults or parameter aliases is covered as well.