From WikiTemp, the GBAtemp wiki
Revision as of 10:10, 6 March 2007 by Dirtie (talk | contribs)

Hi, maybe it's only for admin to use it, but I would like a tutorial on how to create and use a template. I know the {{template name}} thing, for simple template like {{List Ranges}} it's easy to understand and use.

But I don't know how it can change an article's data with complexe template. For exemple the NDS compatibility template {{Slot-1 Compatibility}} use {{{1}}}, {{{2}}}. Is that a mask for data written by a user, so if you change the template the data filled by a user is left as is ? What the subst: stand for ?

Maybe you are still testing it because I didn't see this template in the NDS compatibility list article.

--Cyan 13:22, 5 March 2007 (CET)

The Wikimedia's help page about templates might be of help. But I guess having a short description in GBAtemp's wiki wouldn't hurt either.
Anyway, {{{1}}} means the first parameter given to the template, {{{2}}} means the second parameter, etc. So if you call the template like this {{Template|parameter1|parameter2}}, {{{1}}} will be replaced with parameter1, and {{{2}}} is replaced with parameter2. Don't remember what subst: is though... --Mythril 13:54, 5 March 2007 (CET)
Thank you for your answer, I'll read it. --Cyan 14:14, 5 March 2007 (CET)
The compatibility list is a bad example, simply because it is using custom extensions. Mythril is on the money though. Triple {} brackets means a user-specified parameter that will be passed to the template, and double {} brackets are what you use to call the template. An easy to understand example would be this page. It uses 3 simple templates (which have links at the bottom of the page). Parameters are not required to be numbered either, it just makes it easier when calling the template. For example they could be called Template:Hello this is a parameter or Template:Blah, but to call the template you'd have to insert something along the lines of:
Template:Template name

This page explains templates very nicely (and supersedes the link posted further up the page) Dirtie 11:10, 6 March 2007 (CET)