Jump to content
Toggle menu
  • 3 articles
  • 75 files
  • 7 users
  • 37.9K edits
Neodyland Wiki
Toggle preferences menu
Toggle personal menu
Not logged in
Your IP address will be publicly visible if you make any edits.

Template:Anchor/doc: Difference between revisions

Template page
doc from template page
 
adding info from enwiki @ http://en.wikipedia.org/w/index.php?title=Template:Anchor/doc&oldid=338944514
Line 1: Line 1:
==Usage {{anchor|Example anchor}}==
==Usage==
Inserts a HTML anchor in a page at the location of its invocation, enabling direct #Links to this location.
1. <code style="color:green;"><nowiki>{{</nowiki>{{lc:{{BASEPAGENAME}}}}|foo<nowiki>}}</nowiki></code>
: could be linked to with <tt><nowiki>[[#foo|...]]</nowiki></tt> from within the same article,  
: or it could be linked to with <tt><nowiki>[[</nowiki>''<small>articlename</small>''#foo|...<nowiki>]]</nowiki></tt> from other articles and from redirects.


;Code
2. Anchors can be more suitable for inter-article linking than section titles are. For example,
: <nowiki><</nowiki>span id="<nowiki>{{{anchor|{{{1|anchor}}}}}}</nowiki>" />
:<code style="color:green;"><nowiki>=={{</nowiki>{{lc:{{BASEPAGENAME}}}}|foo<nowiki>}}</nowiki></code><code style="color:gray;"> Section title <nowiki>==</nowiki></code>
:Here, links via <tt><nowiki>[[</nowiki>''articlename''#foo<nowiki>]]</nowiki></tt> would remain valid even if the section were renamed.
 
3. The template can be used to create up to ten anchors with a single call. For example,
: <code style="color:green;"><nowiki>{{</nowiki>{{lc:{{BASEPAGENAME}}}}|foo|bar|baz<nowiki>}}</nowiki></code>
:will create three anchors that can then be linked to with <tt><nowiki>[[#foo]]</nowiki></tt>, <tt><nowiki>[[#bar]]</nowiki></tt> and <tt><nowiki>[[#baz]]</nowiki></tt>.
:Specifying more than 10 anchors will cause an error message to be displayed.


;Usage
: <nowiki>{{</nowiki>anchor|''anchor_name''}}
: <nowiki>{{</nowiki>anchor|1=''anchor_name''}}
: <nowiki>{{</nowiki>anchor|anchor=''anchor_name''}}


==Example==
==Example==
Cookies help us deliver our services. By using our services, you agree to our use of cookies.