
This is an unofficial archive of PsychonautWiki as of 2025-08-11T15:14:44Z. Content on this page may be outdated, incomplete, or inaccurate. Please refer to the original page for the most up-to-date information.
Template:Anchor/doc: Difference between revisions
Jump to navigation
Jump to search
>PJosepherum m 1 revision |
iw>FDMS4 m harmonisation |
||
Line 1: | Line 1: | ||
{{ | {{documentation subpage}} | ||
==Usage== | |||
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. | |||
=== | 2. Anchors can be more suitable for inter-article linking than section titles are. For example, | ||
:<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. | |||
==Example== | |||
=== | ==== <nowiki>{{</nowiki>anchor|Example anchor}} Usage ==== | ||
or | |||
==== <nowiki>{{</nowiki>anchor|anchor=Example anchor}} Usage ==== | |||
''[[Template:Anchor#Example anchor]] (from another page) or [[#Example anchor]] (from this page) will now link to the section called "Usage", as seen above.'' | |||
<includeonly> | |||
[[Category:Formatting templates]] | |||
[[Category:Internal link templates]] | |||
[[ar:template:anchor]] | |||
[[bg:template:anchor]] | |||
[[ca: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> | ||
Revision as of 23:26, 8 September 2014
Usage
1. {{anchor|foo}}
- could be linked to with [[#foo|...]] from within the same article,
- or it could be linked to with [[articlename#foo|...]] from other articles and from redirects.
2. Anchors can be more suitable for inter-article linking than section titles are. For example,
=={{anchor|foo}}
Section title ==
- Here, links via [[articlename#foo]] 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,
{{anchor|foo|bar|baz}}
- will create three anchors that can then be linked to with [[#foo]], [[#bar]] and [[#baz]].
- Specifying more than 10 anchors will cause an error message to be displayed.
Example
==== {{anchor|Example anchor}} Usage ====
or
==== {{anchor|anchor=Example anchor}} Usage ====
Template:Anchor#Example anchor (from another page) or #Example anchor (from this page) will now link to the section called "Usage", as seen above.