Template:Anchor: Difference between revisions

From Yogstation-13
Jump to navigation Jump to search
imported>Jordie0608
(Created page with "{{#if:{{{1|}}}|<span id="{{{1|}}}"></span>}}<noinclude> == How to use == <pre> <nowiki>{{anchor|Firesuit}}</nowiki> </pre> The anchor template works for making internal links ...")
(Added includeonly-tags. Minor rewriting, fixing typo.)
 
Line 1: Line 1:
{{#if:{{{1|}}}|<span id="{{{1|}}}"></span>}}<noinclude>
<includeonly>{{#if:{{{1|}}}|<span id="{{{1|}}}"></span>}}</includeonly><noinclude>
== How to use ==
== About ==
<pre>
Creates an invisible anchor which can be referenced in links. For example, linking to [[Engineering_items#Firesuit]] (Assuming you already have the anchor on the engineering items page to direct the link) will load the page focused on the firesuit. This is useful when you don't have a <code><nowiki>===header===</nowiki></code> for the item in the page.
<nowiki>{{anchor|Firesuit}}</nowiki>
</pre>
The anchor template works for making internal links to specific parts of pages. For example, linking to [[Engineering_items#Firesuit]] (Assuming you already have the anchor on the engineering items page to direct the link) will load the page focused on the firesuit. This is useful when you don't have a <nowiki>===header===</nowiki> for the item in the page.


Important note though; If the page already has a header with the same name as an anchor, a link to anchored item will go to whichever is first. so if the anchor is higher than the header, it will go to the anchor and vice versa. Alternatively, you can just make the anchor have a slightly different name to fix this.
'''Beware:''' If the page already has a header with the same name as an anchor, a link to anchored item will go to whichever is first. So if the anchor is higher than the header, it will go to the anchor and vice versa. Alternatively, you can just make the anchor have a slightly different name to fix this.
 
== Parameter-Usage ==
{| class="wikitable"
!Parameter
!Description
|-
!1
|Anchortext. If missing nothing will be added.
|}
 
== Examples ==
<pre>{{anchor|Test}}
Click to jump: [[#Test]]</pre>
{{anchor|Test}}
Click to jump: [[#Test]]


[[category:templates]]
[[category:templates]]
</noinclude>
</noinclude>

Latest revision as of 10:35, 24 April 2020

About

Creates an invisible anchor which can be referenced in links. For example, linking to Engineering_items#Firesuit (Assuming you already have the anchor on the engineering items page to direct the link) will load the page focused on the firesuit. This is useful when you don't have a ===header=== for the item in the page.

Beware: If the page already has a header with the same name as an anchor, a link to anchored item will go to whichever is first. So if the anchor is higher than the header, it will go to the anchor and vice versa. Alternatively, you can just make the anchor have a slightly different name to fix this.

Parameter-Usage

Parameter Description
1 Anchortext. If missing nothing will be added.

Examples

{{anchor|Test}}
Click to jump: [[#Test]]

Click to jump: #Test