Template:Alpha nav

From Wikipedia, the free encyclopedia
Jump to navigation Jump to search


Template documentation[view] [edit] [history] [purge]

Alphabetic section







This is a set of templates to support the layout of alphabetic sections and list subsections as per above.

Alphabetic sections are supported by three templates:

  • {{Alpha nav}} - alphabetic navigation - produces an alphabetic navigation list for the specified section - somewhat similar to {{compact toc}}
  • {{Eos nav}} - end of section navigation - produces navigation back to the top of the specified section, and to the top of the current page.
  • {{Alpha sect}} - alphabetic section - is used initially to create a new section with alphabetic subsections not populated with any items

Alpha nav

Alpha nav (alphabetic navigation) produces a horizontal, bullet separated, navigation list to subsections A through Z.


The difference between {{alpha nav}} and {{compact toc}} is that alpha nav will, with the use of one parameter, allow multiple alphabetic lists to be easily separately addressed on the one page where as using compact toc to do this would require all 26 subsection addresses to be individually coded as custom links for each list.[Note 1] There is also a style difference in that alpha nav does not present the navigation list as a page table of contents.


  • unnamed parameter - section number - this is the ordinal number of the alphabetic list on the page. The first set of A to Z is number "1", the second set of A to Z on the page is number "2", etc. The default is "1" which defaults internally to NULL.
  • named parameter - num - if set to "yes" will also include navigation to a section called 0 – 9. This is placed before A in the navigation list.


Typically this template would be placed after the section heading for an A to Z subsection list. For example for the second alphabetic list on a page:

 ==Section title 2==
 {{alpha nav|2}}

If the alphabetic subsections are very long then it can be just as easily placed at the end of the subsections as well.

To reduce the lengths of tables of contents with long parts showing essentially redundant and uninformative items A to Z, set {{toc limit|2}}.


For Alpha nav to link to the correct alpha subsection, every one of A through Z must be fully provided in all lists on the page, even if the subsection is empty. If 0 – 9 is specified it will need to be provided, even if empty, up to and including the last list for which it is specified.

Eos nav

Eos nav (end of (sub)section navigation) produces two navigation links, one to the top of the secified section, and a second to the top of the current page.


  • unnamed parameter - section title - the title if the current section, to which back-to-the-top-section should go to.
  • named parameter - align - allows the navigation links to be at "left", "center", or "right". The default is "left".


Typically place the following at the end of a subsection within the section:

 <!-- last item in subsection list  -->
 {{eos nav|Section title}}
 <!-- next subsection or section -->

This produces:

There is no restriction on where it is placed.


The section title must be unique on the whole page across all levels of section. If not unique it will always navigate to the first such title only.[Note 2]

Alpha sect

Alpha sect (alphabetic section) establishes a blank section with a blank subsection for each letter of the alphabet.

The section uses heading title level "==".

The subsection uses heading title level "==="

It also inserts end of subsection navigation links back to the top of the section and back to the top of the page.


  • named parameter - section - the title of the section containing an alphabetic list (a subsection for each letter of the alphabet)
  • named parameter - sectnum - defaults to 1 (which defaults internally to null) - the ordinal number of the section counted within the group of alphabetic list containing sections


To establish an unpopulated list page with multiple alphabetic lists, one each in a section of its own, use the template {{alpha sect}}. This template must be substituted.

For example, to establish the outline content for a blank page with three sections, each with its own alphabetic list of subsections, use the following:

 <!-- Insert lead here -->
 {{toc limit|2}}
 {{subst:alpha sect|section=Section 1 title|sectnum=1}}
 {{subst:alpha sect|section=Section 2 title|sectnum=2}}
 {{subst:alpha sect|section=Section 3 title|sectnum=3}}
 <!-- Insert See also, Notes, Further reading, References, External links sections here -->
 <!-- Insert category links here ->

List items can then be pasted into each alphabetic subsection.


This template can only be substituted.


  1. ^ Individual custom coding for {{compact toc}} would be required for all but the first A to Z list.
  2. ^ eos nav can be forced to navigate to a second or further section of the same name by appending "_n" to the end of the section name where n is the ordinal number of the relevant instance of the section title.

See also

Retrieved from "https://en.wikipedia.org/w/index.php?title=Template:Alpha_nav&oldid=808679134"
This content was retrieved from Wikipedia : http://en.wikipedia.org/wiki/Template:Alpha_nav
This page is based on the copyrighted Wikipedia article "Template:Alpha nav"; it is used under the Creative Commons Attribution-ShareAlike 3.0 Unported License (CC-BY-SA). You may redistribute it, verbatim or modified, providing that you comply with the terms of the CC-BY-SA