Difference between revisions of "Template:Anchored list/doc"

From blackwiki
Jump to navigation Jump to search
blackwiki>The Banner
m (WPCleaner v1.33 - Repaired 1 link to disambiguation page - (You can help) - Ordered list)
blackwiki>Jnestorius
({{Warning|Inserting an element in the middle of a list will break any backlinks to later elements of the list. So don't use this template for such lists; only use it where the list is complete or any additions are guaranteed to be at the end.}})
Line 2: Line 2:
 
<!-- PLEASE ADD CATEGORIES AND INTERWIKIS AT THE BOTTOM OF THIS PAGE -->
 
<!-- PLEASE ADD CATEGORIES AND INTERWIKIS AT THE BOTTOM OF THIS PAGE -->
  
This template can be used to create an [[List (HTML)|ordered list]] which generates [[HTML anchor]]s for every bullet point. This makes it much easier to maintain lists where anchors to individual entries are required.
+
This template can be used to create an [[List (HTML)|ordered list]] which generates [[HTML anchor]]s for every bullet point. This makes it much easier to maintain lists where anchors to individual entries are required.  
 +
 
 +
{{Warning|Inserting an element in the middle of a list will break any backlinks to later elements of the list. So don't use this template for such lists; only use it  if either the list is complete or any additions are guaranteed to be at the end.}}
  
 
Note that if you use it more than once on the same page, you'll need to use the {{para|name}} parameter every time after the first, and with a different name for each, so that the generated anchors are unique. A number or lowercase plain alphabet (non-accented) character is recommended - if you use an invalid character, it will be converted eg. "x y z á" becomes "x_y_z_.C3.A1"
 
Note that if you use it more than once on the same page, you'll need to use the {{para|name}} parameter every time after the first, and with a different name for each, so that the generated anchors are unique. A number or lowercase plain alphabet (non-accented) character is recommended - if you use an invalid character, it will be converted eg. "x y z á" becomes "x_y_z_.C3.A1"

Revision as of 16:25, 6 May 2015

This template can be used to create an ordered list which generates HTML anchors for every bullet point. This makes it much easier to maintain lists where anchors to individual entries are required.

Note that if you use it more than once on the same page, you'll need to use the |name= parameter every time after the first, and with a different name for each, so that the generated anchors are unique. A number or lowercase plain alphabet (non-accented) character is recommended - if you use an invalid character, it will be converted eg. "x y z á" becomes "x_y_z_.C3.A1"

The anchors generated are of the form "alist-x" where x is the list item number (or with |name=2, the form "alist2-x"). So to link to the first entry of a list, use [[pagename#alist-1|linkname]].

Usage

{{ anchored list
|First entry
|Second entry
|So on
...
|Last entry
}}
{{ anchored list |name=2
|First entry
|Second entry
|Third entry
}}
{{ anchored list |name=3
|First entry
|Second entry
|Third entry
}}

Up to 99 entries are supported.

See also