• Home
  • Random
  • Nearby
  • Log in
  • Settings
Donate Now If Wikipedia is useful to you, please give today.
  • About Wikipedia
  • Disclaimers
Wikipedia

Template:Anchored list/sandbox

  • Template
  • Talk
  • Language
  • Watch
  • Edit
< Template:Anchored list
This is the template sandbox page for Template:Anchored list (diff).
See also the companion subpage for test cases.
Template documentation[view] [edit] [history] [purge]
This template uses Lua:
  • Module:Anchored list

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.

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 |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 "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

edit
{{ 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

edit
  • {{Anchor}}
  • {{Glossary}}
  • {{Shortcut}}
  • {{Visible anchor}}
The above documentation is transcluded from Template:Anchored list/doc. (edit | history)
Editors can experiment in this template's sandbox (edit | diff) and testcases (edit) pages.
Add categories to the /doc subpage. Subpages of this template.
Retrieved from "https://en.wikipedia.org/w/index.php?title=Template:Anchored_list/sandbox&oldid=498731858"
Last edited on 21 June 2012, at 21:36

Languages

      This page is not available in other languages.

      Wikipedia
      • Wikimedia Foundation
      • Powered by MediaWiki
      • This page was last edited on 21 June 2012, at 21:36 (UTC).
      • Content is available under CC BY-SA 4.0 unless otherwise noted.
      • Privacy policy
      • About Wikipedia
      • Disclaimers
      • Contact Wikipedia
      • Code of Conduct
      • Developers
      • Statistics
      • Cookie statement
      • Terms of Use
      • Desktop