Difference between revisions of "Template:Anchor/Doc"

From ISFDB
Jump to navigation Jump to search
 
(4 intermediate revisions by the same user not shown)
Line 5: Line 5:
  
 
==Parameters==
 
==Parameters==
*'''id=''' This must specify the anchor ID. The ID should be unique within a wiki page, and is the string which will be used in the link, like "Linking to anchors" in [[Help:Link#Linking to anchors]]).  It must not be empty.  
+
*'''id=''' This must specify the anchor ID. The ID should be unique within a wiki page, and is the string which will be used in the link, like "Linking to anchors" in [[Help:Link#Linking to anchors]]).  It must not be empty. If it is, an error message will display and no anchor will be created.
  
 
:The id parameter may be replaced by the first unnamed parameter.
 
:The id parameter may be replaced by the first unnamed parameter.
Line 21: Line 21:
 
{{Anchor|id=Anchor1|txt=No. 1}}
 
{{Anchor|id=Anchor1|txt=No. 1}}
  
 
+
.<br>
 +
.<br>
 +
.<br>
 +
.<br>
  
  
Line 29: Line 32:
  
 
{{Anchor|Anchor2|No. 2}}
 
{{Anchor|Anchor2|No. 2}}
 +
 +
.<br>
 +
.<br>
 +
.<br>
 +
.<br>
  
 
===Hidden Anchors===
 
===Hidden Anchors===
Line 36: Line 44:
  
 
{{Anchor|id=Anchor3}}
 
{{Anchor|id=Anchor3}}
 +
 +
.<br>
 +
.<br>
 +
.<br>
 +
.<br>
 +
  
  
Line 43: Line 57:
  
 
{{Anchor|Anchor4}}
 
{{Anchor|Anchor4}}
 +
 +
.<br>
 +
.<br>
 +
.<br>
 +
.<br>
 +
.<br>
 +
.<br>
 +
.<br>
 +
.<br>
  
 
===Links to the example anchors===
 
===Links to the example anchors===

Latest revision as of 01:52, 11 August 2010

Purpose

This template is designed to insert a manual anchor into a wiki page so that a link may go to a specific point in the page other than a section header. (An "automatic" anchor is proved at every section header, see Help:Link#Linking to anchors)

An anchor may have anchor text. If it does, the anchor text created by this template is displayed in LightSeaGreen

Parameters

  • id= This must specify the anchor ID. The ID should be unique within a wiki page, and is the string which will be used in the link, like "Linking to anchors" in Help:Link#Linking to anchors). It must not be empty. If it is, an error message will display and no anchor will be created.
The id parameter may be replaced by the first unnamed parameter.
  • txt= The text to display at the anchor. May be empty or omitted for a hidden anchor.
If the ID was given with an unnamed parameter, this may be given with a 2nd unnamed parameter.

Examples

Visible Anchors

{{Anchor|id=Anchor1|txt=No. 1}}

gives

No. 1

.
.
.
.


{{Anchor|Anchor2|No. 2}}

gives

No. 2

.
.
.
.

Hidden Anchors

{{Anchor|id=Anchor3}}

gives

.
.
.
.


{{Anchor|Anchor4}}

gives

.
.
.
.
.
.
.
.

Links to the example anchors