Template:CategoryTOC

From Avlis Wiki
Revision as of 15:46, 7 February 2017 by Gorgon (talk | contribs) (Template:CategoryTOC- adds a horizontal ''alphanumeric'' table of contents (TOC) to a category page.)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search


Template:CategoryTOC

This template is based on Template:CategoryTOC.

It uses a modified version of the original markup, with various improvements and fixes. The documentation below was copied to this template, since we do not use documentation sub-pages. MediaWiki specific information, links and sub-templates have either been removed, or modified for the Avlis wiki. It has been reformatted, and modified for current usage with improved clarity.

See the original template documentation for further details.


Template documentation

This template adds a horizontal alphanumeric table of contents (TOC) to a category page. It should only be added to category pages (normally after any category description, so it is above the first Subcategories or Pages in category heading). It is generally used for categories containing at least 200 total pages.


Usage

{{CategoryTOC
 | align     = center / left / right
 | top       = yes / no
 | numerals  = group / separate / no
 | uppercase = yes / no
 | lowercase = no / yes
 | float     = no / yes
}}


Parameters

align - Specifies the position. Default "value" is center:

  • center (default)
  • left
  • right


top - Specifies if a link to the top of the category is included. Default "value" is yes:

  • yes (default)
  • no


numerals - Specifies if numerals are included Default "value" is group:

  • group (default): There is one link for 0-9.
  • separate: Each numeral 0, 1, ..., 9 has a separate link.
  • no: No numeral link.


uppercase - Specifies if a link for each uppercase letter (A, B, ..., Z) is included. Default "value" is yes:

  • yes (default)
  • no


lowercase - Specifies if a link for each lowercase letter (a, b, ..., z) is included. Default "value" is no:

  • no (default)
  • yes


float - This specifies if the TOC should float around the next element (the default align = center does not float). See Notes for more details. Default "value" is no:

  • no (default)
  • yes


Notes

  • Parameter "values" in this template are not case sensitive, so either uppercase or lowercase "values" will work.
    E.g., align = Left, align = LEFT or align = lEfT are all valid "values".
    • Parameter "names" are case sensitive, and always lowercase!
      E.g., Align = left is not a valid parameter "name".


  • Parameters that are assigned any "value", other than the ones listed in Parameters (above), will use their default "value".
    E.g., align = bottom, align = Foo or align =  (defined with an empty/blank "value") will all use the default align = center "value".


  • The MediaWiki version of Template:CategoryTOC (what this is based on), will float around the next element (usually the first Subcategories or Pages in category heading) when align = left or align = right are used. While this adds more flexibility to category page design, it also means basic usage requires adding some method to clear the float. The Wikipedia version of Category TOC does not float, since this can easily be added to a floating container element instead.
Rather than forcing users to do it one way or the other, this template has an extra float parameter. The default "value" is no (like Wikipedia's version that doesn't float), and setting the "value" to yes will restore floating (the behavior of MediaWiki's version). This is primarily a convenience option, so that basic usage doesn't require extra markup, without losing the original float functionality. As mentioned, a simple container element can be used to make this float as well (with more options), so using the float parameter is entirely optional.