Template:TOC maker

From Ballotpedia
Jump to: navigation, search
Contents




Do Not Edit this Template if you are unfamiliar with it. It is delicate and will break easily. Contact Joshualmeyer for more information.


This template is designed to replace Tables of Contents on pages which use headertabs. Typically the headertabs interact poorly with the table of contents. The result is that while the Table of contents displays on the front page with all of the headings, links for any tab or heading not on the first tab fail. To ameliorate this problem, we have developed a tempalte to automatically build a table of contents for your page. You merely need to copy and past the heading and tab names into the appropriate corresponding numbers in order to create the TOC. The code for it looks like this: {{TOC maker|1H=Court|1.1=Vacancy warning level|1.2=Jurisdiction|1.3=History|1.3.1=Court history|1.3.2=Court building|1.4=External links|1.5=References|2H=Judges}}

Which looks like this:

Contents
1 Court
1.1 Vacancy warning level
1.2 Jurisdiction
1.3 History
1.3.1 Court history
1.3.2 Court building
1.4 External links
1.5 References
2 Judges

Parameters

Example United States District Court for the District of Columbia

The template works like any inclusion template, except that it uses numbers instead of words to place the corresponding elements at the appropriate place in the template. Thus "1 = " would be the first main heading, "1.1 =" and "1.2 = " would be the first two sub headings under the first heading and "2 = " would be the second main heading. The template is designed to hold 7 main headings, with 6 sub headings under that (1.1,1.2,...1.6) and each sub heading has 6 sub headings (1.1.1,1.1.2,...1.1.6). Thus the lowest heading would be "7.6.6 =".

Headertab parameters

Example United States District Court for the District of Columbia

Headertab parameters were included so as to accommodate this template's use where it is most needed. Header tabs have a single number followed by a H(capital letter required). Thus your first header tab is 1H, then 2H all the way to 7H. Because of the limitations associated with the parser function used to link to headertabs they cannot list subheadings and successfully link to them. Instead, one option is to generate a separate table of contents for every page. Another is to generate one for the first page with extra links to the header tabs. As always, table of contents management is up to the discretion of the page creator and/or the project and project manager.

Eliminating the TOC

Every page which uses this template should include the tag __NOTOC__ on the bottom of the page, after the <headertabs /> tag.