User:Toomai/Wiki tips and tricks

From SmashWiki, the Super Smash Bros. wiki
Jump to navigationJump to search

If this kind of thing would do better elsewhere, go ahead and move it.

If you've got a tip or trick to add, go ahead and put it.

General[edit]

  • Always use the preview button. One wrong key can cause an entire page to go out of whack.

Tables[edit]

  • ALWAYS preview before saving! Mistakes in a single place can make tables look horrendous, especially if you've got merged cells.
  • Putting class="wikitable sortable" in a table's header (that is, right after the {|) will allow users to sort the table. This doesn't work if cells are merged, however.
  • Generally, things in a table look better when they're centered (with the exception of large blocks of text). Putting style="text-align:center" in the header will center all the text in every cell.
  • Generally, tables themselves look better when in the middle of a page. Put align="center" in the header to do this.
  • Use ! instead of | when starting cells that are headers. However, you still need to use a | to separate parameters (such as colouring) from the cell's content. Example:
!make it red|put text here!!make it yellow|put text here

Images[edit]

  • Normally, clicking an image leads to the image itself. However, by adding the link parameter, you can make images just like normal links. Usually, it's best to leave images as linking to themselves, since linking them forces people to look at the source to find out where an image came from. However, there are cases where linking them is better (such as the Tier list templates).
This image leads to File:MarioIcon(SSBB).png This image leads to Mario (SSBB)
MarioIcon(SSBB).png MarioIcon(SSBB).png
[[File:MarioIcon(SSBB).png|50px]] [[File:MarioIcon(SSBB).png|50px|link=Mario (SSBB)]]

Formatting[edit]

  • Formats have to be closed in the opposite order they were opened. Otherwise, odd stuff happens.
This Looks like this
Text '''[[Main page]]''' Text Text Main page Text
Text '''[[Main page''']] Text Text Main page''' Text
Blah <s>cross <sup>yoik</sup> doof</s> bladoonga Blah cross yoik doof bladoonga
Blah <s>cross <sup>y</s>o<s>ik</sup> doof</s> bladoonga Blah cross yoik doof bladoonga
Blah <s>cross <sup>yoik</s> doof</sup> bladoonga Blah cross yoik doof bladoonga
  • Colour on the internet is represented by a six-digit hexadecimal number (prefaced on wikis by "#"). Hex numbers use the letters A to F as extra digits - A is 10, while F is 15. Basically, the first two digits are the amount of red, the next two are the green, and the last two are the blue. So, 000000 is pure black, 7F0000 is 50% red (brown), and FFBF7F is 100% red, 75% green, and 50% blue (tan). While adding colour can sometimes be distracting, there are times when it can have a positive effect. Here are some simple colours:
Colour Slight fade Medium fade Strong fade
FF0000 FF3F3F FF7F7F FFBFBF
FF7F00 FF9F3F FFBF7F FFDFBF
FFFF00 FFFF3F FFFF7F FFFFBF
00FF00 3FFF3F 7FFF7F BFFFBF
00FFFF 3FFFFF 7FFFFF BFFFFF
0000FF 3F3FFF 7F7FFF BFBFFF
FF00FF FF3FFF FF7FFF FFBFFF

Templates/Infoboxes[edit]

  • Many things can be improved by using parser functions (see below).
  • If you need to put a | somewhere, but its location causes things to mess up, use {{!}}. A shortcut for || is {{!!}}.

Parser Functions[edit]

Basically, a parser function is something that does something based on a condition. Think of it like low-level programming in a wiki page. You'll pretty much always be using this for templates. The best way to explain this kind of stuff is through examples.

Code Input Output What It Does
{{{stuff|Unknown}}}
stuff=Bonk Bonk If "stuff" is specified, display it, otherwise display "Unknown".
  Unknown
{{#if:{{{this|}}}|[{{{this}}}]|}}
this=Yes
that=No
[Yes] If "this" is specified, display it in square brackets, otherwise display nothing.
that=Yes  
{{#ifeq:{{{pyro|n}}}|y|Stab|Sap}}
pyro=y Stab If "pyro" is equal to "y", display "Stab". If "pyro" is equal to something else, display "Sap". If "pyro" is not specified, assume it is "n" (and therefore display "Sap").
pyro=n Sap
  Sap
{{#ifeq:{{{pyro|{{{engy|n}}}}}}|y|Stab|Sap}}
pyro=y Stab If "pyro" is equal to "y", display "Stab". If "pyro" is equal to something else, display "Sap". If "pyro" is not specified, then use whatever "engy" is - if that's not specified either, use n (and therefore display "Sap").
pyro=y
engy=n
Stab
pyro=n
engy=y
Stab
engy=n Sap
  Sap
{{#expr:100-{{{m}}}}}
m=45 55 Display whatever the result of 100-m is. Be careful with this one, since if an error happens (such as m being a letter or division by zero) it explodes into bold red text.