Open main menu

Changes

m
Reverted edits by 92.13.203.227 (talk) to last version by SMcCandlish
{{Documentation subpage}}
<!-- 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.

{{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 e.g. "x y z á" becomes "x_y_z_.C3.A1"

The anchors generated are of the form "<code>alist-<var>x</var></code>" where <code><var>x</var></code> is the list item number (or with {{para|name|<var>2</var>}}, the form "<code>alist<var>2</var>-<var>x</var></code>"). So to link to the first entry of a list, use <code><nowiki>[[pagename#alist-1|linkname]]</nowiki></code>.

=== Usage ===

<pre>
{{ anchored list
|First entry
|Second entry
|So on
...
|Last entry
}}
</pre>

<pre>
{{ anchored list |name=2
|First entry
|Second entry
|Third entry
}}
</pre>

<pre>
{{ anchored list |name=3
|First entry
|Second entry
|Third entry
}}
</pre>

Up to 99 entries are supported.

=== See also ===
* {{tl|Anchor}}
* {{tl|Glossary}}
* {{tl|Shortcut}}
* {{tl|Visible anchor}}

<includeonly>{{#ifeq:{{SUBPAGENAME}}|sandbox||
<!-- CATEGORIES AND INTERWIKIS HERE, THANKS -->
[[Category:List formatting and function templates]]
}}</includeonly>
Anonymous user