Help:Navbox
Part of a series of tutorials for the Refuge Wiki | |||||||||||||||||||
Tutorial Navigation
| |||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Demo Pages
| |||||||||||||||||||
Templates within MediaWiki function by calling on elements defined in the CSS file, in the JavaScript file, or just by using raw html. Templates exist to allow users to navigate this code without rewriting it countless times or by using elements that are too complicated to easily be understood. The Template:Infobox functions by using elements defined in the CSS file, while the Template:Navbox calls on the table forming mechanics of CSS. Since they're both templates within this wiki, knowledge about how either system works is unnecessary to fill one out.
This page will show you have to fill out the infobox and navbox templates for use on your pages. See Help:Templates for help on creating your own template from scratch.
Nav boxes are placed at the bottom of related pages, such as all of the pages within a single RP, so that you can easily travel from one to the other, especially pages that aren't linked within the article you're looking at. We're going to create a version of the tutorial navigation box on the side of this article as one such navbox for the Demo Article and Demo Nation to simulate what they would normally look like in an RP.
We can begin by navigating to the page that we want to create. In this example, it's going to be called {{tdp}}, because the acronym of the pages it represents is also usually shorthand for how it's remembered. If you want the template to be called tdp for "Tutorial-Demo Pages", the template must be located at Template:tdp. In any page or article on this wiki, the capitalisation of a word will be represented as you type it, except for the first letter, which will always be shown as capital in the title and can be represented either way in the template.
This can be displayed using this example:
Calls Template:Tdp | Calls to Template:tDp |
---|---|
{{tdp}} {{Tdp}} |
{{tDp}}
{{TDp}} |
In Template:tdp, we'll start by writing {{navbox. Two units of { indicate that we're calling a template that already exists, in this case, it's Template:Navbox.
{{navbox
The next line we'll add is |name = tdp This is how the name is going to be defined for your organisational purposes, so it should mirror the location that the template is written. Each instance of | indicates an input slot that was designated in the template we're working in. So "name|" is registered as an input in Template:Navbox that means we can put something there.
{{navbox |name = tdp
Next, we'll add |image = [[File:Wiki.png|80px]]. In the premade Navbox template, this will add an image in the centre middle part of the panel which will feature a relevant image to the theme. In some RPs, this is the world map. It can also be the RP's logo or whatever you come up with. Since this navbox is for a demo article, we'll just use the Wiki's logo. Remember that you can define how big an image is scaled by using a vertical pipe and specifying the number of pixels wide you'd like it to display.
{{navbox |name = tdp |image = [[File:Wiki.png|80px]]
Notice how there is abundant whitespace in between the variables and what we've input for them. When the code is run, all of this is reduced to a single white space. Therefore, you may use as many spaces as you would like to organise your template and make it easier for you and everyone else to read.