Difference between revisions of "Template:Anchor"
Jump to navigation
Jump to search
DESiegel60 (talk | contribs) |
DESiegel60 (talk | contribs) |
||
Line 1: | Line 1: | ||
<includeonly>{{qif | <includeonly>{{qif | ||
|test={{{id|{{{1|}}}}}} | |test={{{id|{{{1|}}}}}} | ||
− | |then=<span id="{{{id|{{{1}}}}}}" | + | |then=<span id="{{{id|{{{1}}}}}}" style="color:LightSeaGreen">{{{txt|{{{2|}}}}}}</span> |
|else=<span style="color:Red">'''ERROR:''' Anchor ID not specified</span> | |else=<span style="color:Red">'''ERROR:''' Anchor ID not specified</span> | ||
}}</includeonly><noinclude> | }}</includeonly><noinclude> |
Latest revision as of 01:44, 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
.
.
.
.
.
.
.
.