Nested Key Test

From Biowikifarm Metawiki
Jump to: navigation, search

NOTE: This information has also been saved under Template:Key_Start/doc so that this page is truly a test page.

Introduction

Identification keys often contain a nested level, for example for a key to subspecies. A common design is:

1  Statement A:  Aus bus
  a  Statement a:  Aus bus ssp. ixus
  a* Statement b:  b
  b  Statement c:  Aus bus ssp. ypsilon
  b* Statement d:  Aus bus ssp. zeta
1* Statement B:  2
2  Statement C:  Aus cus
  a  Statement e:  Aus cus ssp. ixus
  a* Statement f:  b
  b  Statement g:  Aus cus ssp. ypsilon
  b* Statement h:  Aus cus ssp. zeta
2* Statement D:  Aus dus

Note that the subkey is indented, but also that the lead numbers are unique only with respect to the parent lead. Thus "Statement A" implicitly leads to a Statement 1a, "Statement C" implicitly leads to a Statement 2a.

Implementation

If a parameter "parentlead=" is filled, it is assumed that the present lead is nested within a parent lead. So the start of the example above would be written as:

{{Lead | 1 | Statement A | result= Aus bus | 1a }}
{{Lead | parentlead=1 | a | Statement a | result= Aus bus ssp. ixus}}
{{Lead | parentlead=1 | a*| Statement b | b }}
{{Lead | parentlead=1 | b | Statement c | result= Aus bus ssp. ypsilon}}
{{Lead | parentlead=1 | b*| Statement d | result= Aus bus ssp. zeta}}
{{Lead | 1*| Statement B | 2 }}
{{Lead | 2 | Statement C | result= Aus cus | 2a }}
{{Lead | parentlead=1 | a | Statement e | result= Aus cus ssp. ixus}}
{{Lead | parentlead=1 | a*| Statement f | b }}
{{Lead | parentlead=1 | b | Statement g | result= Aus cus ssp. ypsilon}}
{{Lead | parentlead=1 | b*| Statement h | result= Aus cus ssp. zeta}}
{{Lead | 2*| Statement D | result= Aus dus }}

This creates a key with:

  1. The first Lead has a result and also links to the nested key.
  2. The nested key leads (a and a*) are inherit the parent lead for the purpose of linking.
  3. The nested are fully indented

Example

{{Key Start | id = NESTED
 | title = Test key with of nested subkeys
 }}
{{Lead | 1 | Statement A | result= Aus bus | nested=a }}
{{Lead | parentlead=1 | a | Statement a | result= Aus bus ssp. ixus}}
{{Lead | parentlead=1 | a*| Statement b | b }}
{{Lead | parentlead=1 | b | Statement c | result= Aus bus ssp. ypsilon}}
{{Lead | parentlead=1 | b*| Statement d | result= Aus bus ssp. zeta}}
{{Lead | 1*| Statement B | 2 }}
{{Lead | 2 | Statement C | result= Aus cus }}
{{Lead | 2*| Statement D | result= Aus dus }}
{{Key End}}

results in:

Test key with of nested subkeys
1
Statement A   Aus bus
  ▼▼ a
a
Statement a   Aus bus ssp. ixus
a*
Statement b   ► b
b
Statement c   Aus bus ssp. ypsilon
b*
Statement d   Aus bus ssp. zeta
1*
Statement B   ► 2
2
Statement C   Aus cus
2*
Statement D   Aus dus

Alternative: embedding an entire new key

{{Key Start | id = PARENT | flags = jkey-autostart
 | title = Test of nested key
 }}
{{Lead | 1 | Statement A 
| remarks= {{Key Start | id = EMBEDDED  | flags = jkey-nocontrols }}
{{Lead | parentlead=1 | a | Statement a | result= Aus bus ssp. ixus}}
{{Lead | parentlead=1 | a*| Statement b | b }}
{{Lead | parentlead=1 | b | Statement c | result= Aus bus ssp. ypsilon}}
{{Lead | parentlead=1 | b*| Statement d | result= Aus bus ssp. zeta}}
{{Key End}}
| result= Aus bus | nested=a }}
{{Lead | 1*| Statement B | 2 }}
{{Lead | 2 | Statement C | result= Aus cus | nested=a }}
{{Lead | parentlead=2 | a | Statement e | result= Aus cus ssp. ixus}}
{{Lead | parentlead=2 | a*| Statement f | b }}
{{Lead | parentlead=2 | b | Statement g | result= Aus cus ssp. ypsilon}}
{{Lead | parentlead=2 | b*| Statement h | result= Aus cus ssp. zeta}}
{{Lead | 2*| Statement D | result= Aus dus }}
{{Key End}}

results in:

Test of nested key
1
1*
Statement B   ► 2
2
Statement C   Aus cus
  ▼▼ a
a
Statement e   Aus cus ssp. ixus
a*
Statement f   ► b
b
Statement g   Aus cus ssp. ypsilon
b*
Statement h   Aus cus ssp. zeta
2*
Statement D   Aus dus