Wikicode: Difference between revisions
Hid some content to make the page not as big. Updated images section.
imported>Spike68 (Added some info, sortable wikitables) |
imported>Spike68 (Hid some content to make the page not as big. Updated images section.) |
||
Line 137: | Line 137: | ||
To use any template, you need to reference the name of it's page within double brackets {{}}, then define the variables. A good example of a useful template is the <nowiki>{{Item}}</nowiki> template. The <nowiki>{{Item}}</nowiki> template actually uses multiple templates within itself, but I won't go into much detail about that. When you want to use the <nowiki>{{Item}}</nowiki> template, paste the code from the page like so: | To use any template, you need to reference the name of it's page within double brackets {{}}, then define the variables. A good example of a useful template is the <nowiki>{{Item}}</nowiki> template. The <nowiki>{{Item}}</nowiki> template actually uses multiple templates within itself, but I won't go into much detail about that. When you want to use the <nowiki>{{Item}}</nowiki> template, paste the code from the page like so: | ||
<pre> | <div class="toccolours mw-collapsible mw-collapsed"><pre> | ||
{{Item | {{Item | ||
|name=Test Item | |name=Test Item | ||
Line 143: | Line 143: | ||
|bgcolor2 = #FFDD66 | |bgcolor2 = #FFDD66 | ||
|image = Redtoolbox.png | |image = Redtoolbox.png | ||
}} </pre> | }} </pre></div> | ||
Then your template (in this case, our item box) shows on the page like so: | Then your template (in this case, our item box) shows on the page like so: | ||
{{Item | {{Item | ||
Line 159: | Line 159: | ||
Tables are similar to templates, mostly just because they are a type of coding that define stuff. Most templates end up using a table of some sort to make it look pretty anyways. An extremely simple table works like so: | Tables are similar to templates, mostly just because they are a type of coding that define stuff. Most templates end up using a table of some sort to make it look pretty anyways. An extremely simple table works like so: | ||
<pre>{| class="wikitable" | <div class="toccolours mw-collapsible mw-collapsed"><pre>{| class="wikitable" | ||
|- | |- | ||
! One || Two | ! One || Two | ||
|- | |- | ||
| Three || Four | | Three || Four | ||
|}</pre> | |}</pre></div> | ||
Gives us | Gives us | ||
Line 176: | Line 176: | ||
Each part of the code defines where it belongs and what it does. The '''{|''' and '''|}''' are the opening and closing brackets of our table, they indicate the start and the end. The '''class="wikitable"''' defines the style of the table borders. Instead, you could replace the class with '''border=''' and define the size and style of the border. The '''|-''' indicates the end of a row, and adding a new line after it will make an extra row beneath it. The '''!''' defines the row to be a title of sorts, which also defaults the text to be centered in the box. In the case of the '''class="wikitable"''', it makes the row a different color. The '''||''' marks the end of the box, and any data past it will be in the next box over. | Each part of the code defines where it belongs and what it does. The '''{|''' and '''|}''' are the opening and closing brackets of our table, they indicate the start and the end. The '''class="wikitable"''' defines the style of the table borders. Instead, you could replace the class with '''border=''' and define the size and style of the border. The '''|-''' indicates the end of a row, and adding a new line after it will make an extra row beneath it. The '''!''' defines the row to be a title of sorts, which also defaults the text to be centered in the box. In the case of the '''class="wikitable"''', it makes the row a different color. The '''||''' marks the end of the box, and any data past it will be in the next box over. | ||
To add more to a table, simple add a column with '''||''', or add a new row by making a new line and adding '''|-''' then another line and '''|'''. | To add more to a table, simple add a column with '''||''', or add a new row by making a new line and adding '''|-''' then another line and '''|'''. | ||
<pre> | <div class="toccolours mw-collapsible mw-collapsed"><pre> | ||
{| class="wikitable" | {| class="wikitable" | ||
|- | |- | ||
Line 184: | Line 184: | ||
|- | |- | ||
| One || More || Time | | One || More || Time | ||
|}</pre> | |}</pre></div> | ||
{| class="wikitable" | {| class="wikitable" | ||
Line 194: | Line 194: | ||
| One || More || Time | | One || More || Time | ||
|} | |} | ||
<pre> | <div class="toccolours mw-collapsible mw-collapsed"><pre> | ||
{| class="wikitable" || style="text-align: center;" | {| class="wikitable" || style="text-align: center;" | ||
|- | |- | ||
Line 204: | Line 204: | ||
|- | |- | ||
|style="background: blue; color: white" | Three || 3 || 6 || 9 | |style="background: blue; color: white" | Three || 3 || 6 || 9 | ||
|}</pre> | |}</pre></div> | ||
{| class="wikitable" | style="text-align: center;" | {| class="wikitable" | style="text-align: center;" | ||
Line 218: | Line 218: | ||
And a sortable table: | And a sortable table: | ||
<pre> | <div class="toccolours mw-collapsible mw-collapsed"><pre> | ||
{| class="wikitable sortable" border="1" | {| class="wikitable sortable" border="1" | ||
|- | |- | ||
Line 239: | Line 239: | ||
| 3 || 6 || 9 || 1 | | 3 || 6 || 9 || 1 | ||
|- | |- | ||
|}</pre> | |}</pre></div> | ||
{| class="wikitable sortable" border="1" | {| class="wikitable sortable" border="1" | ||
Line 271: | Line 271: | ||
| <nowiki>[[File:Generic_engineer.png]]</nowiki> || [[File:Generic_engineer.png]] | | <nowiki>[[File:Generic_engineer.png]]</nowiki> || [[File:Generic_engineer.png]] | ||
|} | |} | ||
When you simply call up an image, it will be in it's full sized format. Resizing the image is | When you simply call up an image, it will be in it's full sized format. Resizing the image is not simple anymore. Adding |thumb after the file name forces it to be a thumbnail size. If the image is already smaller than the thumbnail size, then the image will not be re-sized. Also, the image will be placed in a frame (which you can add without making the image a thumbnail by adding |frame instead) and default to the right side of the page. The location of the image can also be changed by adding |left or |center. | ||
{| class="wikitable" | style="text-align: center;" | {| class="wikitable" | style="text-align: center;" | ||
|- | |- | ||
! | ! This || Gives us this | ||
|- | |- | ||
| <nowiki>[[File:Generic_engineer.png|thumb|left]]</nowiki> || [[File:Generic_engineer.png|thumb|left | | <nowiki>[[File:Generic_engineer.png|thumb|left]]</nowiki> || [[File:Generic_engineer.png|thumb|left]] | ||
|} | |} | ||
<br> | <br> | ||
Sometimes the thumb is too big or too small. So instead, you can replace |thumb with '''| | Sometimes the thumb is too big or too small. So instead, you can replace |thumb with '''|30px''', where the 30 can be any sized number (assuming you don't want it larger than an average screen). The '''px''' stands for pixels, and does not need to be changed. For some reason the wiki seems to have issues shrinking images, so I have no clue how to properly thumbnail other than uploading a separate smaller version of the image. | ||
<br> | <br> | ||
When any image is placed on a page, clicking the picture will take you to another page. The default setting takes you to the images page, where you can view the upload history of that specific image. By adding a '''|link=www.example.com''' or '''|link=Engineering''', you can make the image link to another internal or external page. Also, adding text such as '''|text goes here''' adds a small pop-up dialog that shows the defined text. | When any image is placed on a page, clicking the picture will take you to another page. The default setting takes you to the images page, where you can view the upload history of that specific image. By adding a '''|link=www.example.com''' or '''|link=Engineering''', you can make the image link to another internal or external page. Also, adding text such as '''|text goes here''' adds a small pop-up dialog that shows the defined text. | ||
Line 292: | Line 287: | ||
! This || Gives us this | ! This || Gives us this | ||
|- | |- | ||
| <nowiki>[[File: | | <nowiki>[[File:locker.png|link=Storage_items#Lockers|This is a locker]]</nowiki> || [[File:locker.png|link=Storage_items#Lockers|This is a locker]] | ||
|}<br> | |}<br> | ||