User:Vigilius/keys

From Wikipedia, the free encyclopedia

Get help on writing a template: Wikipedia:Requested_templates, see also category template coder


[edit] Testing better ways to write dichotomous keys (better than the wikibooks example)

Flowers green
Flowers red or blue . . . 1
1. Flowers red . . . Vigilius
1.' Flowers blue . . . Vigilius



Note: the ref template (an older version of <ref />!) contains autonumbering:

Usage: First parameter after "ref" is the link-label (=id/anchor name). Second parameter is a display label. If missing, the footnote references are autonumbered. The Refs have anchor #ref_+first parameter, and link to #endnote_+first parameter. The Notes have anchor #endnote_+first parameter, and link to #ref_+first parameter.

"It is sometimes useful to use ref templates more than once with the same reference_name. Whenever that is done, an optional parameter noid=noid should be specified, in exactly that form.

Examples:

  • Refs: fuu[1] fuu[2]
  • Refs with 2nd parameter set to x,y: fuux fuuy
  • Notes with 1 parameter ^  bla1; ^  bla2
  • Notes with 2nd parameter set to v, w^v  bla1; ^w  bla2


Ref and Note templates, first shortened (remove documentation, sub, part of the span) and (wrongly!) reformatted for readability:

<span 
{{#ifeq:{{{noid}}}
  |noid
  |
  |id="ref_{{{1}}}"
}}>
{{#if:{{{2|}}}
 |[[ #endnote_{{{1}}} | {{{2}}} ]]
 |[ {{fullurl: {{FULLPAGENAME}} }}#endnote_{{{1|}}} ]
}}
</span>


<cite id="endnote_{{{1}}}" style="font-style: normal;">
  [[ #ref_{{{1}}} | '''^{{{2|}}}''' ]]
</cite> 

Some notes: #if is: condition|result-if-existing|result-if-not-existing. The condition is always true unless it is empty or whitespace-only!!! #ifeq is value1 | value2 | result-if-equal | result-if-not-equal.

Unclear, why the " | " inside the double-bracket link works, and is different from the #if bar! Also: where does the printed brackets around the footnote number come from? Why is parameter 1, which is something like name_A displayed as autoincrementing number???

Now full original versions:

**"Ref"** (not "Ref label"!) is:
<span class="reference plainlinksneverexpand" {{#ifeq:{{{noid}}}|noid||id="ref_{{{1}}}"}}><sup>{{#if:{{{2|}}}|[[#endnote_{{{1}}}|{{{2}}}]]|[{{fullurl:{{FULLPAGENAME}}}}#endnote_{{{1|}}}]}}</sup></span><noinclude>
{{pp-template}}{{documentation}}
<!-- Add categories and interwikis to the /doc subpage, not here! -->
</noinclude>

**"Note"** is:
<cite id="endnote_{{{1}}}" style="font-style: normal;">[[#ref_{{{1}}}|'''^{{{2|}}}''']]</cite> <noinclude>{{pp-template}}
----
Using ref/note tags is not the only way to do [[Wikipedia:Footnotes|footnotes]]. Some people prefer to use [[m:Cite/Cite.php|Cite.php]]. Cite.php has many advantages, but the use of it is not mandatory. You can use the [[User:Cyde/Ref converter|Ref converter]] to replace ref/note tags with the newer [[m:Cite/Cite.php|Cite.php]] style. Be aware that some articles use both the Note and Ref systems to provide separate Notes and References sections. If you are interested in the discussion, please see the [[Wikipedia_talk:Footnotes|Footnotes talk page]].
[[Category:Citation templates|{{PAGENAME}}]]
[[Category:Inline templates|{{PAGENAME}}]]
[[sl:Predloga:Opomba]]
[[sv:Mall:not]]
</noinclude>



http://en.wikipedia.org/wiki/Wikipedia:Footnote3

Examples use "Ref label":

X[A]

A  Components may not sum to totals due to rounding

The variable extension does not seem to be active in main WP! Setting {{#vardefine:varname|11}} and getting {{#var:varname}} produces: Setting {{#vardefine:varname|11}} and getting {{#var:varname}}