From SN Guides
Introduction
This page shows how to create a footer template as shown in Image 1 below, and explains how you would change it to make a similar entry. The template in this example contains a table that includes a set up hotspots to jump to Directory entries for all the ships in a class of WW1 Battleships. It has been added to the Directory entries for all the ships in the class and if it needs to be changed this can be done once in the template and it will propagate to all the Directory entries that use it.
It is not particularly difficult to create a template of this type but it needs attention to detail. In addition to entering the data (The exact name of the Directory entries of the ships in this case) you have to include special entries to specify how the table is to be laid out.
Example footer template
This template described here is shown in Image 1 below.
Image 1:
You can click here to see how this works on one of the actual Directory entries where it is used. (The template is at the bottom of this entry).
Basic table mark-up codes
Special characters are used to specify the layout of the table. The commonly used ones are shown below; more are available, and if you like a challenge, you will find them in the default Table help page here: Help:Tables. Unless you are into computers (and even if you are!) you will probably find the default page difficult to follow - certainly much more so than this page!
The use of these codes will make more sense when you see the notes on the example in the next section.
| Basic table mark-up codes
|
| {| | The left curly bracket followed by the vertical bar characters denote the start of the table.
|
| | | The vertical bar character denotes the beginning of a cell of data in the table. You can either put one table cell on each line, or put multiple cells on a line by separating the data by double marks (||) Cells will continue on the same row until a new row is defined
|
| |- | The vertical bar character followed by the dash character denotes the start of a new row in the table
|
| |} | The vertical bar character followed by the right curly bracket denotes the end of the table.
|
Construction of the example table
The table was created using an 7-line entry so it is pretty easy really. To help explain it, a line number has been inserted at the beginning of each line and will be referred to in the next section.
Line 1 {| border="1" cellpadding="20" cellspacing="0"
Line 2 |colspan="3"|'''Bellerophon Class Battleships'''
Line 3 |-
Line 4 |[[Bellerophon Class Battleship - HMS Bellerophon]]
Line 5 |[[Bellerophon Class Battleship - HMS Superb]]
Line 6 |[[Bellerophon Class Battleship - HMS Temeraire]]
Line 7 |}
Explanation
- Line 1: This starts with the "Start table" codes {| and the rest of it specify the border and cell spacing. These values work for most tables so can be used as they are in most cases.
- Line 2: This line is used to set the table heading. The number 3 used with colspan specifies that the heading will span 3 columns - the vertical bar and remaining text specifies what will go in the heading
- Line 3: The |- character codes specifies that a new row should start
- Line 4: This line contains the first item of data preceded by the | character code
- Lines 5 and 6: These contain more data - again each item preceded by the | character code
- Line 7: This line contains the "end of table" character codes |}
Making your own footer based on the example
If you want to base your footer on the example quoted here follow these steps:
- Create a new template document with the name of your choice. Remember that it must have a name that starts "Template:" for example the one in the example is called "Template:Bellerophon Class Battleships".
- Add the following line in the template exactly as shown: {{subst:Bellerophon Class Battleships}}
- Save the template - you will see that the template now contains a duplicate of the "Bellerphon Class Battleships" template
- Open your template for editing and substitute the heading you want to show on the line starting with "colspan"
- Substitute the exact names of the Directory entries you want to jump to adding more lines as needed
- Remember to prefix each data item by the | character code
- Adjust the number of items on each line by adding or removing new rows
- See what it looks like by pressing the Show Preview button
- When it looks about right, save it in case something goes wrong or you will have to start again!
- Adjust as appropriate - check out the Gotcha section below if it doesn't behave as you expect
Gotchas
- "My table is showing Line 1 etc. at the begining of lines."
- The "Line 1:" etc. entries were included here to explain how to create a table and should not be used. Delete them and try again
- "The heading does not go across the correct number of cells in the table"
- Check the value of "colspan" - it should be equal to the number of items in each row
- "There are too many items in a row and it looks peculiar"
- You may have to experiment a bit to get this right. If your data entries are short you may get 4 or more items on a row but if they are long you may have to go down to 2 or even one item per row. Remember to adjust the "colspan" value if you make changes
- "The table shows up in black text on a white background instead of normal colours"
- If this happens check that there are no spaces at the beginning of the affected lines - start typing on the far left and don't leave spaces or this will happen
- "Some of the Directory pages I want to jump to show up as white and some as green - why is that?"
- Existing Directory pages will show up in white. Ones that do not yet exist show up in green. If you think the page showing up in green really does exist, the most likely explanation is that you do not have the name exactly right. Make sure you include capital letters, spaces and punctuation marks exactly as used.