Jump to content
Toggle menu
  • 8 articles
  • 75 files
  • 7 users
  • 37.8K 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
m harmonisation
Fix language-code links to use Wikipedia interwiki prefixes
 
(5 intermediate revisions by 3 users not shown)
Line 1: Line 1:
{{documentation subpage}}
{{Lua|Module:Anchor}}
{{TemplateBox
|1        = 1
|1aliases = anchor
|1label-en= First anchor
|1d-en    = The text that will be the first anchor
|1type    = line
|1def    =
|1stat    = required


==Usage==
|2        = 2
1. <code style="color:green;"><nowiki>{{</nowiki>{{lc:{{BASEPAGENAME}}}}|foo<nowiki>}}</nowiki></code>
|2label-en= Second anchor
: could be linked to with <tt><nowiki>[[#foo|...]]</nowiki></tt> from within the same article,
|2d-en    = The text that will be the second anchor
: or it could be linked to with <tt><nowiki>[[</nowiki>''<small>articlename</small>''#foo|...<nowiki>]]</nowiki></tt> from other articles and from redirects.
|2type    = line
|2def    =
|2stat    = optional-


2. Anchors can be more suitable for inter-article linking than section titles are. For example,
|3        = 3
:<code style="color:green;"><nowiki>=={{</nowiki>{{lc:{{BASEPAGENAME}}}}|foo<nowiki>}}</nowiki></code><code style="color:gray;"> Section title <nowiki>==</nowiki></code>
|3label-en= Third anchor
:Here, links via <tt><nowiki>[[</nowiki>''articlename''#foo<nowiki>]]</nowiki></tt> would remain valid even if the section were renamed.
|3d-en    = The text that will be the third anchor
|3type    = line
|3def    =  
|3stat    = optional-


3. The template can be used to create up to ten anchors with a single call. For example,
|name              = anchor
: <code style="color:green;"><nowiki>{{</nowiki>{{lc:{{BASEPAGENAME}}}}|foo|bar|baz<nowiki>}}</nowiki></code>  
|desc-en            = This template creates an anchor where it is placed, that is, a point which can be linked like a section header either from somewhere within that page, another Commons page, or another website. It has no visual output. (This template documentation lists three parameters, but you may use virtually any number of unnamed parameters for more anchors.)
: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>.
|namespace          = all
:Specifying more than 10 anchors will cause an error message to be displayed.
|usergroup          = all
|placement          =
|usage-notes        =
1. <code style="color:green;"><nowiki>{{anchor|foo}}</nowiki></code>
: could be linked to with <code><nowiki>[[#foo|...]]</nowiki></code> from within the same article,  
: or it could be linked to with <code><nowiki>[[</nowiki>''<small>articlename</small>''#foo<nowiki>|…]]</nowiki></code> from other articles and from redirects.


 
2. Anchors can be more suitable for inter-article linking than section titles are. For example,
==Example==
:<code style="color:green;"><nowiki>=={{anchor|foo}}</nowiki></code><code style="color:gray;"> Section title <nowiki>==</nowiki></code>
 
:Here, links via <code><nowiki>[[</nowiki>''articlename''#foo<nowiki>]]</nowiki></code> would remain valid even if the section were renamed.
==== <nowiki>{{</nowiki>anchor|Example anchor}} Usage ====
|type              =
or
|example            =
==== <nowiki>{{</nowiki>anchor|anchor=Example anchor}} Usage ====
|example-value      =
 
|i18n-method        = -
''[[Template:Anchor#Example anchor]] (from another page) or [[#Example anchor]] (from this page) will now link to the section called "Usage", as seen above.''
|i18n-desc          =
 
|i18n-mediawiki-msg =  
<includeonly>
|i18n-subpage      =  
|seealso            =  
|setscats          =  
|print              =  
|shorthand          =
|relieson          = [[Module:Anchor]]
|mustbesubst        =
|useTemplateData    = only
}}<includeonly>
[[Category:Formatting templates]]
[[Category:Formatting templates]]
[[Category:Internal link templates]]
[[Category:Internal link templates]]
[[ar:template:anchor]]
 
[[bg:template:anchor]]
[[w:eo:Ŝablono:Ankro2]]
[[ca:template:anchor]]
[[w:ja:Template:Anchor]]
[[cs:template:anchor]]
[[da:template:anchor]]
[[de:Vorlage:Anker]]
[[el:template:anchor]]
[[en:template:anchor]]
[[eo:template:anchor]]
[[eu:template:anchor]]
[[fa:template:anchor]]
[[fi:template:anchor]]
[[fr:template:anchor]]
[[hsb:template:anchor]]
[[he:תבנית:עוגן2]]
[[hu:template:anchor]]
[[is:template:anchor]]
[[ja:template:anchor]]
[[ko:template:anchor]]
[[ks:template:anchor]]
[[la:template:anchor]]
[[mi:template:anchor]]
[[nds:template:anchor]]
[[nl:template:anchor]]
[[nn:template:anchor]]
[[no:template:anchor]]
[[oc:template:anchor]]
[[pl:template:anchor]]
[[ps:template:anchor]]
[[pt:template:anchor]]
[[rmy:template:anchor]]
[[ro:template:anchor]]
[[ru:template:anchor]]
[[sd:template:anchor]]
[[simple:template:anchor]]
[[sl:template:Sidro]]
[[sq:template:anchor]]
[[sr:template:anchor]]
[[sv:template:anchor]]
[[sw:template:anchor]]
[[te:template:anchor]]
[[tn:template:anchor]]
[[uk:template:anchor]]
[[ur:template:anchor]]
[[vi:template:anchor]]
[[yi:template:anchor]]
[[zh:template:anchor]]
</includeonly>
</includeonly>
Cookies help us deliver our services. By using our services, you agree to our use of cookies.