Template:Anc: Difference between revisions
Content added Content deleted
imported>FrozenPlum m (Doc for alternative anchor) |
imported>FrozenPlum m (Undo revision 1356, wrong page) |
||
Line 1: | Line 1: | ||
<onlyinclude><includeonly><span id="{{{1}}}">{{{2|}}}</span></includeonly></onlyinclude> |
<onlyinclude><includeonly><span id="{{{1}}}">{{{2|}}}</span></includeonly></onlyinclude> |
||
{{Documentation}} |
{{Documentation}} |
||
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: |
|||
* <code><nowiki>{{anc|anchorname}}</nowiki></code> - displays no text, just creates a hidden anchor. |
|||
* <code><nowiki>{{anc|anchorname|anchor text}}</nowiki></code> - anchors to specific text. |
|||
'''Important notes''': |
|||
* Spaces cannot be used in anchor names. |
|||
* Only these symbols can be used in an anchor name: hyphen <code>-</code>, underscore<code>_</code>, colon <code>:</code>, period <code>.</code> |
|||
If you used <code><nowiki>{{anc|anchorname|anchor text}}</nowiki></code> on a page, you could link to it with <code><nowiki>[[Pagename#anchorname]]</nowiki></code> to cause the link to jump to the anchor. |
|||
<includeonly> |
|||
<!-- Template categories/interwikis here --> |
|||
[[Category:Templates]] |
|||
</includeonly> |
Latest revision as of 03:31, 2 April 2022
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.
[view | edit | purge]The above documentation is transcluded from Template:Anc/doc.