Tip: Multi-page Table of Contents

From Gumnickopedia

Jump to: navigation, search
You can use a template to create a box or bar that contains links to several related pages, then place it on all of the relevant pages.

For example, on all of the pages related to the Gumnick-Jones Wedding, we’ve used a template called {{GJWeddingContents}}, which looks like this:

<table cellpadding="4" width="100%">
<tr bgcolor="lavender">
<td align="center" valign="middle">
Gumnick-Jones Wedding pages: [[Gumnick-Jones Wedding|Main]] 
| [[Gumnick-Jones Wedding: The Readings|The Readings]] 
| [[Gumnick-Jones Wedding: The Guest Book Table|The Guest 
Book Table]] · See also [[Gumnick Family Reunion 2006]].
</td>
</tr>
</table>
----
<includeonly>
[[Category:Beth]]
[[Category:Rich]]
[[Category:Weddings]]
</includeonly>
<noinclude>
[[Category:Templates]]
</noinclude>

This code sets up a single-cell shaded table with links to all of the pages that belong to the related group. Then there’s a horizontal rule (----), and then a list of categories within <includeonly> commands, which makes pages that use this template show up in the Beth, Rich, and Weddings categories, but not the template itself. There’s also a [[Category:Template]] command within <noinclude> commands, which causes the template, but not the resulting pages, to be listed in the Templates category.

  To use the template, we paste the code
{{GJWeddingContents}}
at the top of each of the relevant pages. Then if we decide to add a new page to the group, we can link to it from all of the other pages by adding a new link to the table-of-contents template (instead of editing every page in the group). (Also, paste the {{GJWeddingContents}} code at the top of the new page.)


Click the “Back“ button on your browser to return to the page from which you came.
Personal tools