Category talk:Standardization Templates

From Twilight Heroes Wiki
Revision as of 08:11, 2 March 2008 by Satan (talk | contribs)

Jump to: navigation, search

How does one create a template? --Livia 21:29, 1 March 2008 (MST)

Do a search for template:template name here, no space before or after the colon. That'll bring up a page you can edit. Use the <includeonly> and </includeonly> tags to surround your template code. Variables are inserted by {{{variable name here}}} or, alternatively, just put a 1, 2, 3, etc. where variable name is. That will allow you to not have to define what the variable is, in this way: {{template name here|x|y|z}}. In that example, x would go to the first variable, y would go to the second, z to the third, etc. You can use {{#if: {{{variable name here|}}}|do this}} which will put whatever is after the second | into that place in the code only if the variable is defined on the page you call the template on. You can use {{#switch: {{{variable name here|}}}|x=1|y=2|z=3|(and so on)}} to make the template insert 1 if the variable is defined as x, 2 if defined as y, 3 if defined z. In case it needs to be stated, you can make x, y, and z anything you want, and you can make 1, 2, and 3 anything you want. There's also a #ifeq command, but I'm not 100% sure what it does. If you need help with anything else, Valera can probably help you more. - Satan