Template:Anc: Difference between revisions

Content deleted Content added
imported>FrozenPlum
m Doc for alternative anchor
imported>FrozenPlum
m Undo revision 1356, wrong page
 
Line 1:
<onlyinclude><includeonly><span id="{{{1}}}">{{{2|}}}</span></includeonly></onlyinclude>
{{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>