Template:Anchor: Difference between revisions

From bg3.wiki
Jump to navigation Jump to search
(Created page with "{{<includeonly>safesubst:</includeonly>#invoke:anchor|main}}")
 
No edit summary
 
(2 intermediate revisions by one other user not shown)
Line 1: Line 1:
{{<includeonly>safesubst:</includeonly>#invoke:anchor|main}}
{{<includeonly>safesubst:</includeonly>#invoke:anchor|main}}<noinclude>
{{license|ccbysa|https://en.m.wikipedia.org/wiki/Template:Anchor|Wikipedia}}
The template <nowiki>{{</nowiki>[[{{ns:Template}}:{{BASEPAGENAME}}|{{lc:{{BASEPAGENAME}}}}]]<nowiki>}}</nowiki> inserts one or more invisible anchor names (HTML fragment identifiers) in a page.
 
The basic format is <code><nowiki>{{anchor|Anchor name}}</nowiki></code>. To link to an anchor from within the same page, use <code><nowiki>[[#Anchor name|display text]]</nowiki></code>. {{#ifeq:{{BASEPAGENAME}}|Visible anchor|&nbsp;Unlike {{tl|Anchor}}, the first parameter will be visible text on the page.|}} To link to an anchor from another page, use <code><nowiki>[[Article name#Anchor name|display text]]</nowiki></code>. See [https://en.wikipedia.org/wiki/Template:Anchor Wikipedia's page for this template] for more details.
 
Note that <code><nowiki>#Anchor name</nowiki></code>, used by the MediaWiki software to (usually) direct users to sections within a page, is not a wikitext directive like <code><nowiki>#redirect</nowiki></code>.
 
Anchors are most useful with sections, since links to a section will not work if a section is renamed. However, anchors can be used as needed anywhere in an article. The anchor name can be arbitrary, but the first letter should generally be capitalized in keeping with header style.
 
[[Category:Templates]]
</noinclude>

Latest revision as of 14:33, 1 November 2023

This Template page is licensed under CC BY-SA 4.0. See Wikipedia for the original.

The template {{anchor}} inserts one or more invisible anchor names (HTML fragment identifiers) in a page.

The basic format is {{anchor|Anchor name}}. To link to an anchor from within the same page, use [[#Anchor name|display text]]. To link to an anchor from another page, use [[Article name#Anchor name|display text]]. See Wikipedia's page for this template for more details.

Note that #Anchor name, used by the MediaWiki software to (usually) direct users to sections within a page, is not a wikitext directive like #redirect.

Anchors are most useful with sections, since links to a section will not work if a section is renamed. However, anchors can be used as needed anywhere in an article. The anchor name can be arbitrary, but the first letter should generally be capitalized in keeping with header style.