Difference between revisions of "Template:Anchor"

From SoftMC-Wiki
Jump to: navigation, search
m (Draft)
m (added description for underscores in anchor)
 
(5 intermediate revisions by the same user not shown)
Line 1: Line 1:
<includeonly><!-- {{#tag:span|{{{1}}}|id={{#if:{{{2|}}}|{{{2}}}|{{{1}}}}}}} --><span id={{#if:{{{2|}}}|{{{2}}}|{{{1}}}}}>{{{1}}}</span></includeonly><!--  
+
<includeonly><span id={{anchorencode:{{#if:{{{2|}}}|{{{2}}}|{{{1}}}}}}}>{{{1}}}</span></includeonly><!--  
  
  
Line 6: Line 6:
 
{{Template
 
{{Template
 
|description=
 
|description=
Adds an html anchor to the page, which can be by [[#myAnchor]].
+
Adds a html anchor to the page, which can be referenced by [[#anchor]].
  
 
|template=<nowiki>{{Anchor|text|anchor}}</nowiki>
 
|template=<nowiki>{{Anchor|text|anchor}}</nowiki>
Line 15: Line 15:
 
;anchor (optional)
 
;anchor (optional)
 
: Anchor string. If missing, ''text'' is used as anchor string.
 
: Anchor string. If missing, ''text'' is used as anchor string.
 +
: Note: Spaces in ''anchor'' are converted to underscores (<code>_</code>)!
  
 
|examples=
 
|examples=
<pre>{{Anchor|Any Text with ''style''|myAnchor}}</pre>
+
;Input
{{Anchor|Any Text with ''style''|myAnchor}}
+
<pre>
 +
* The {{Anchor|output}} is described below.
 +
* {{Anchor|Any Text with ''style''|my Anchor}}
 +
</pre>
 +
;Output
 +
* The {{Anchor|output}} is described below.
 +
*{{Anchor|Any Text with ''style''|my Anchor}}
 +
;References
 +
: Go to [[#output]] or [[#my_Anchor]].
 
}}
 
}}
 +
 +
== Long page simulation ==
 +
*1
 +
*2
 +
*3
 +
*4
 +
*5
 +
*6
 +
*7
 +
*8
 +
*9
 +
*10
 +
*1
 +
*2
 +
*3
 +
*4
 +
*5
 +
*6
 +
*7
 +
*8
 +
*9
 +
*10
 +
*1
 +
*2
 +
*3
 +
*4
 +
*5
 +
*6
 +
*7
 +
*8
 +
*9
 +
*10
 +
*1
 +
*2
 +
*3
 +
*4
 +
*5
 +
*6
 +
*7
 +
*8
 +
*9
 +
*10
  
 
[[Category:Templates]]
 
[[Category:Templates]]
 
</noinclude>
 
</noinclude>

Latest revision as of 14:13, 7 November 2011

Adds a html anchor to the page, which can be referenced by #anchor.

Template

{{Anchor|text|anchor}}

Parameters

text
Display text
anchor (optional)
Anchor string. If missing, text is used as anchor string.
Note: Spaces in anchor are converted to underscores (_)!

Examples

Input
* The {{Anchor|output}} is described below.
* {{Anchor|Any Text with ''style''|my Anchor}}
Output
  • The output is described below.
  • Any Text with style
References
Go to #output or #my_Anchor.

For more examples refer to pages, which use this template: What links here.

Help:Templates describes general usage of templates, including treatment of special characters.


Long page simulation

  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10