FANDOM


Hey! User:Henstepl here. I saw that some users were having trouble making navboxes, and didn't really see a way for them to move forward that didn't involve gross Lua that involves its own learning curve. So I'm making a guide to show you how to make a simple navbox! It's super easy!

SUBWAY sandwiches
Chicken & Bacon Ranch MeltBlack Forest HamCold Cut ComboItalian B.M.T.Meatball MarinaraOven Roasted ChickenRoast BeefRotisserie-Style ChickenSpicy ItalianSteak & CheeseSubway ClubSweet Onion Chicken TeriyakiClassic TunaTurkey BreastVeggie Delite
Breakfast sandwiches
Bacon, Egg & CheeseBlack Forest Ham, Egg & CheeseSteak, Egg & CheeseEgg & Cheese
Veggies
LettuceSpinachTomatoesCucumbersPicklesOlivesOnionsBell peppersBanana peppersJalapeño peppers


Every wiki on creation has a template at Template:Navbox identical in content to the navbox from Starter Pages Wiki. It could be used as a meta template, meaning one could create a second template, say Template:Navbox Foo, that calls Template:Navbox. But this is restrictive, and might be too much for new users to deal with, so we won't treat it as a meta template.

Let's just make our own.

Creating the Navbox

The first step is deciding where to put it. On my c:subway, the Unofficial Subway Sandwich Artists' Wiki, I placed my navbox at Template:Navbox SUBWAY. "Navbox <subject>" is a pretty standard location for navboxes.

With our location in mind, let's create the navbox.

Do you have the default form of Template:Navbox installed on your wiki? Click "No, or I don't know" or "Yes".

  1. Go to the page Template:Navbox SUBWAY on your wiki[footnotes 1] and hit "Edit".
    Remember to substitute in the name of the infobox you want instead of "SUBWAY"! If you're asked for a template type, use "Navbox".
  2. Optional - As an edit summary, paste the following:
    Copied from [[w:c:starter:Template:Navbox]]
    This custom edit summary is optional but a good idea.
  3. In another tab, go to the code for Template:Navbox on Starter Pages Wiki and copy the source code to the field for "Template:Navbox SUBWAY" on your wiki.
  4. Save the page - I advise you don't edit the code any before you save it, so you have something clean to revert to if necessary,

  1. Go to the page Template:Navbox SUBWAY on your wiki[footnotes 1] and hit "Edit".
    Remember to substitute in the name of the infobox you want instead of "SUBWAY"! If you're asked for a template type, use "Navbox".
  2. Optional - As an edit summary, paste the following:
    Copied from [[Template:Navbox]]
    This custom edit summary is optional but a good idea.
  3. In another tab, go to Template:Navbox on your wiki[footnotes 1] and copy the source code to the field for "Template:Navbox SUBWAY" on your wiki.
  4. Save the page - I advise you don't edit the code any before you save it, so you have something clean to revert to if necessary.

Customizing the Navbox

First, let's get a sense for the code of the navbox.

An explanation of the code of the navbox
The code An explanation

{| style="width:100%; margin-top:1em; border:1px solid #999; font-size:90%; text-align:center;"
|-
! style="background-color:#3366CC; color:#FFFFFF; padding:0.2em 0.5em;" nowrap="nowrap" | {{{header}}}

|-
| style="padding:0.2em 0.5em;" | {{{body}}}

|}<noinclude>
{{documentation}}</noinclude>

Opens navbox; best to leave this alone
The code for the heading of the navbox
Highlighted is the coloration of the heading, default is blue

The code for the content of the navbox

Closes navbox; best to leave this alone
Calls for documentation, best to leave this alone


It's pretty simply laid out even if you're not super familiar with wiki markup. Let's get editing!

DON'T CHANGE THE PAGE Template:Navbox! You're supposed to leave it unchanged and edit other infobox templates, which you can copy from Template:Navbox. Instead, you should edit Template:Navbox SUBWAY, or whatever you've decided to call the template, on your wiki[footnotes 1]

Editing header and content

Click here to see how I did it!

By default, the navbox has one header, highlighted in red in the above code. The {{{header}}} is where the header text would be inserted if we were using this as a meta template (calling a |header = parameter), but we're not. So, just go ahead and replace that with what you'd like your header to say!

Underneath the header is a content element, highlighted in blue. By default it is filled with a {{{body}}}. We'll just replace that with content too. Most people would put a lot of links here, separated by &bull;, which on page save turns into •. Neat!

Moar headers! Moar contents!

Click here to see how I did it!

One of the reasons we're not using the default Template:Navbox as a meta template is that it's restricted to one header. Maybe we want more, though. So let's just add some. It's as easy as copying the entirety of the red and blue parts of the above code, and pasting them right below themselves. Then just fill them in, as we did in the previous step!

Coloration

Click here to see how I did it!

The default color of the header is pretty blatant and not in line with most wikis' styles. We can go ahead and change it by changing the background-color attribute of our headers. In the above code, this styling and the one for the color of the text itself is highlighted in yellow.

You may use a hex color generator to find your desired color, or you might just get by with "red" or "blue" if it suits you.

Documentation

Documentation is a good idea for any template. This is a static template, with no parameters, so as it is, we can describe its function in one line entirely:

Place this template at the bottom of a page with {{Navbox SUBWAY}}.

Go ahead and save that text to Template:Navbox SUBWAY/doc on your wiki.[footnotes 1]

We did it!

Now we have a useful navbox template to put at the bottom of our articles! Hooray! That was easy, wasn't it?

Notes

  1. 1.0 1.1 1.2 1.3 1.4 A number of times, this page refers to pages on your wiki, such as "Template:Navbox on your wiki". I don't know what your wiki is, so I can't directly link to it.
    If you're having trouble finding the correct page, just go to <yourwiki>.wikia.com/wiki/<page> by typing it in your browser's address bar.
    Or just click the link to go to the equivalent page on Community Central, then edit the URL so that community.wikia.com is substituted with your wiki's URL: for example subway.wikia.com.