Template:Anc/doc: Difference between revisions

From DynamicPageList3 Manual
Content added Content deleted
imported>FrozenPlum
(Create template doc)
 
imported>FrozenPlum
m (Fix doc, made an error on it while moving my content from one page to another)
 
Line 1: Line 1:
{{Documentation subpage}}
<onlyinclude><includeonly><span id="{{{1}}}">{{{2|}}}</span></includeonly></onlyinclude>
{{Documentation}}
<!-- Documentation here -->


Anchors (also known as named anchors) are elements on a page that create a place to link to, outside of MediaWiki's section anchors. This template creates a span with an ID that you specify, which '''must be lowercase''' so it doesn't interfere with MediaWiki's built-in heading/Table of Contents anchors, which use uppercase for the first letter.
Anchors (also known as named anchors) are elements on a page that create a place to link to, outside of MediaWiki's section anchors. This template creates a span with an ID that you specify, which '''must be lowercase''' so it doesn't interfere with MediaWiki's built-in heading/Table of Contents anchors, which use uppercase for the first letter.

Latest revision as of 03:35, 2 April 2022

This is the documentation page, it should be transcluded into the main template page. See Template:Documentation for more information

Anchors (also known as named anchors) are elements on a page that create a place to link to, outside of MediaWiki's section anchors. This template creates a span with an ID that you specify, which must be lowercase so it doesn't interfere with MediaWiki's built-in heading/Table of Contents anchors, which use uppercase for the first letter.

Usage

Place one of the following on the page where you'd like to be able to link to directly:

  • {{anc|anchorname}} - displays no text, just creates a hidden anchor.
  • {{anc|anchorname|anchor text}} - anchors to specific text.

Important notes:

  • Spaces cannot be used in anchor names.
  • Only these symbols can be used in an anchor name: hyphen -, underscore_, colon :, period .

If you used {{anc|anchorname|anchor text}} on a page, you could link to it with [[Pagename#anchorname]] to cause the link to jump to the anchor.