Help:Header tabs

From Ballotpedia
Revision as of 21:44, 11 July 2013 by Abqualls (Talk | contribs)

Jump to: navigation, search
:Category:Help

This page explains how you can install header tabs on Ballotpedia articles.

You can see examples of the use of header tabs on these articles:

The basic idea of header tabs is to have information appear under clickable tabs rather than in a vertical Table of Contents. The title or name that goes on a particular tab would be the name of the section, if you were using a vertical Table of Contents.

How to install

Header tab example

To install header tabs, you need to do three things.

Step one

Typically, when you have sections in an article, you surround the title of a section by a set of two "==" symbols. To convert to header tabs, you have to instead encase the title of the section with just one set of "=" symbols. So, your first step in an existing article that is currently formatted using a vertical Table of Contents is to go through the section headings and remove one = from before and after each section heading.

For example, you would change this:


==1900-1909==
==1910-1919==
==1920-1929==

to this:


=1900-1909=

=1910-1919=

=1920-1929=

Step two

After the final section of the set of section headings you want to convert to header tabs, type:

<headertabs/>

Step three

Scroll down to the end of the article and type:

__NOTOC__

Editing within a tab

If you've set a page up with header tabs, you can set up the text within one tab to have multiple editable sections. To do this, for the text within that section, simply use the standard section headings with either double or triple == symbols before and after the subsection heading/title.

Linking to a tab

You can link from one page on Ballotpedia to a specific tab on a different page.

You do this by typing:

{{#switchtablink:Tab name|Link text|Page name}}

This creates a link to the tab with the name "Tab name", and the text of the link will read "Link text."

Here's an example:

Type:

{{#switchtablink:Utah|Utah ballot measures on the 1958 ballot|1958 ballot measures}}

and get:

Utah ballot measures on the 1958 ballot

This sends the reader to the content on that particular tab. If you don't do this, and you send a reader to that page, they'll be taken to the content of the first tab on the page. Linking to the specific content on a secondary tab is therefore an important convenience for your reader.

Limitations

You can only place one set of header tabs on an article.

Header tabs practice

To get practice on how to work with header tabs, apply header tabs to one of these pages. (Once you've done that, delete that page from this list.)

Acknowledgement