Difference between revisions of "User:SyntaxTerror/Sandbox"

From RimWorld Wiki
Jump to navigation Jump to search
(template anchor)
Line 11: Line 11:
 
-->{{#if:{{{10|}}}|<span class="error">[[Template:Anchor]] : you cannot use more than 9 parameters.</span>}}<!--
 
-->{{#if:{{{10|}}}|<span class="error">[[Template:Anchor]] : you cannot use more than 9 parameters.</span>}}<!--
 
--></includeonly><noinclude>
 
--></includeonly><noinclude>
 +
== Use ==
 +
This template allows you to create invisible "anchors" in a page that can be used as link targets. This can be useful to make direct links to table rows for example.
  
 +
To link to an anchor from within the same page, use <code><nowiki>[[#Anchor name|display text]]</nowiki></code>. To link to an anchor from another page, use <code><nowiki>[[Article name#Anchor name|display text]]</nowiki></code>.
  
[[user:SyntaxTerror/Sandbox#1]]
+
Up to nine different "anchors" (names) can be given to a single template. There is no limit to the number of uses of this template in a page.
[[user:SyntaxTerror/Sandbox#2]]
+
[[user:SyntaxTerror/Sandbox#3]]
+
If the same name is used several times, the link will only point to the first occurrence of the template on the page.
 +
 
 +
== Syntax ==
 +
* <code><nowiki>{{Anchor|''Name of anchor 1''|...|''Name of anchor 9''}}</nowiki></code>
 +
 
 +
== Example ==
 +
<code><nowiki>Something{{Anchor|Something}}</nowiki></code> in the wikicode of a page can be linked using:
 +
* <code><nowiki>[[#Something]]</nowiki></code> on the same page.
 +
* <code><nowiki>[[Name of the page#Something]]</nowiki></code> on another page.
  
* 001 {{user:SyntaxTerror/Sandbox|1|2|3|4|5|6|7|8|9|10|11|12}}
 
* 002
 
* 003
 
* 004
 
* 005
 
* 006
 
* 007
 
* 008
 
* 009
 
* 010
 
* 011
 
* 012
 
* 013
 
* 014
 
* 015
 
* 016
 
* 017
 
* 018
 
* 019
 
* 020
 
* 021
 
* 022
 
* 023
 
* 024
 
* 025
 
* 026
 
* 027
 
* 028
 
* 029
 
* 030
 
* 031
 
* 032
 
* 033
 
* 034
 
* 035
 
* 036
 
* 037
 
* 038
 
* 039
 
* 040
 
* 041
 
* 042
 
* 043
 
* 044
 
* 045
 
* 046
 
* 047
 
* 048
 
* 049
 
* 050
 
* 051
 
* 052
 
* 053
 
* 054
 
* 055
 
* 056
 
* 057
 
* 058
 
* 059
 
* 060
 
* 061
 
* 062
 
* 063
 
* 064
 
* 065
 
* 066
 
* 067
 
* 068
 
* 069
 
* 070
 
* 071
 
* 072
 
* 073
 
* 074
 
* 075
 
* 076
 
* 077
 
* 078
 
* 079
 
* 080
 
* 081
 
* 082
 
* 083
 
* 084
 
* 085
 
* 086
 
* 087
 
* 088
 
* 089
 
* 090
 
* 091
 
* 092
 
* 093
 
* 094
 
* 095
 
* 096
 
* 097
 
* 098
 
* 099
 
* 100
 
* 101
 
* 102
 
* 103 {{user:SyntaxTerror/Sandbox|2}}
 
* 104
 
* 105
 
* 106
 
* 107
 
* 108
 
* 109
 
* 110
 
* 111
 
* 112
 
* 113
 
* 114
 
* 115
 
* 116
 
* 117
 
* 118
 
* 119
 
* 120
 
* 121
 
* 122
 
* 123
 
* 124
 
* 125
 
* 126
 
* 127
 
* 128
 
* 129
 
* 130
 
* 131
 
* 132
 
* 133
 
* 134
 
* 135
 
* 136
 
* 137
 
* 138
 
* 139
 
* 140 {{user:SyntaxTerror/Sandbox|3}}
 
 
</noinclude>
 
</noinclude>

Revision as of 01:55, 23 August 2021

Use

This template allows you to create invisible "anchors" in a page that can be used as link targets. This can be useful to make direct links to table rows for example.

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]].

Up to nine different "anchors" (names) can be given to a single template. There is no limit to the number of uses of this template in a page.

If the same name is used several times, the link will only point to the first occurrence of the template on the page.

Syntax

  • {{Anchor|''Name of anchor 1''|...|''Name of anchor 9''}}

Example

Something{{Anchor|Something}} in the wikicode of a page can be linked using:

  • [[#Something]] on the same page.
  • [[Name of the page#Something]] on another page.