Help:Editing/Advanced techniques

These are some additional features of MediaWiki code that can be used in articles. For more basic techniques, see Help:Editing.

Formatting
To make a line across the page, use four hyphens:

To display plain text that is pre-formatted, preserving the line breaks it has, use the    tag: &lt;pre&gt;Everything in here retains the line breaks it has.&lt;/pre&gt;

To embed a video (see Help:Files for more details):

If a display of wiki coding is wanted, use the "nowiki" HTML-like tag around the code. The following produces the text " Main Page " rather than creating a link:
 * Main Page

If you do not wish to include something on a page but want it on another page that includes that page, add "includeonly" tags around the code:
 * code to be included only

Similarly, information in "noinclude" tags is only displayed on the original page:
 * this is not included in pages that include this one

As well as this, a fair amount of HTML is functional. Tags such as    and     can be given a style attribute to add some CSS, in the form  content  .

Links
To link to a page in another wiki, place its interwiki prefix at the start of the link. This prefix is not necessarily the wiki's title; a full list can be found at Special:Interwiki. Pikmin Fanon's main page, for example, is found here:
 * fanon:Main Page

To add an external link (a link to a website outside of NIWA, MediaWiki, Wikipedia and a few others), use single square bracket. It is necessary to include the prefix ( http://, https://, ftp://, irc://, etc.):
 * 

Again, it is possible to change the displayed text. This time, however, simply leave a space between the address and the text. The following example displays Google link:
 * Google link

Media
This includes images and audio files. To include them on pages, link to them as you would an article. As with categories, adding a colon before the namespace creates a link rather than showing the media.


 * To show an image:
 * [[File:image name]]


 * To link to the description page of an image.
 * File:image name


 * To link to the image file itself rather than the description page:
 * [[Media:image name]]

Arguments
As with links, arguments are separated by pipe ("|") characters, all placed within the square brackets. For starters, it is possible to display the image at a different width. This measurement requires a unit: use pixels, abbreviated "px".


 * To show an image at a width of 300 pixels:
 * image name

To display a frame around an image, pass frame as an argument; images included like this cannot be resized. To give an image a frame and resize it, you want a thumbnail: use thumb. By default, thumbnails are displayed at the size set in the user's preferences (or the original image size, if smaller), so it is recommended not to define a width.

Images with frames can be given captions, by passing the text of the caption to display as an extra argument.


 * Thumbnail image with the caption "this is an image":
 * image name

The alignment of images is important to the layout of the page. The default value for this argument is none, which leaves the image "inline": it is displayed in line with text in the same paragraph. Images with frames, on the other hand, are "floated" right by default: float images with left or right, to make text and other inline or floated elements of the page flow around the image. Finally, center centers an image on the page, making text before and after it leave a gap to either side, instead of flowing around.


 * Centred image with a width of 350 pixels:
 * image name


 * Image in a frame, displayed in line with text, with the caption "inline image":
 * image name

The order of arguments is flexible, to some degree; measurements are interpreted as widths, for example. Follow the examples throughout this section for a guide as to what can work, and if the result isn't looking like you expected, try switching arguments around.

Templates and inclusions
Any page can be included in another page by way of enclosing it in double curly parentheses. Write the page name as you would in a link. This includes everything on that other page wherever the code is put:



When a number of pages need similar information or layouts, templates are used, which are pages in the Template namespace created to be included in other pages. They make pages shorter and remove complex code, and allow many pages to be altered at the same time. If a namespace is not supplied in the inclusion code, Template is used by default; to include a page in the main namespace, use.

It is possible to pass information to templates when including them, which make the content displayed different. These are either named or numbered, and used as follows:

In the template, these are referred to as "", "" and so on, and can be put anywhere, as if they were text or code. For example, the following template, included as above, would display "This template contains a piece of information and another piece of information.":
 * This template contains and.

These can be named to make things easier to follow:

Template:
 * My name is and I am  years old.

Code:

Result:
 * My name is Bob and I am 5 years old.

Magic words
So-called "magic words" are pieces of code that affect the layout of a page; here are a few of the common ones. Note that there are two underscores on either side of each: