قالب:Automatic taxobox/doc/method


Note: This is a draft of the documentation: Improvements are warmly welcomed. Please tweak, modify or restructure it if you think that you can make it clearer!


This template combines user input with a taxonomic database to produce an information box for taxa.

Some information needs to be provided manually, using parameters such as |authority=Linneaus, 1784. Other information is fetched from a taxonomic database made up of many pages on Wikipedia with titles that begin "Template:Taxonomy/".

Step one: Fixed information

Example taxobox
|image=
|image caption=
التصنيف العلمي

This will be generated in step 2
المرادفات
|synonyms=

Non-taxonomic content, such as images, is generated in the same way as with other Wikipedia templates. You specify code that looks like this:

 {{Automatic taxobox
 | image = name of image.jpg
 | image caption = Text of caption
 | synonyms = ''Synonymus exemplus''
 }}


Step two: Starting to generate taxonomy

Example taxobox
|image=
|image caption=
التصنيف العلمي

This will be filled in based on the value of |taxon=, or the name of the page
المرادفات
|synonyms=

Next, the template needs to work out which taxon's taxonomy to display. If the parameter |taxon= is set, it will use this taxon: Otherwise, it will try to guess the taxon name from the name of the article that it is on.


Step three: Generating the taxonomy

Example taxobox
|image=
|image caption=
التصنيف العلمي
... ...
"Rank" specified at Template:Taxonomy/Dinosauria "Link" specified at Template:Taxonomy/Dinosauria
المرادفات
|synonyms=

The template is now going to consult the database to build a taxonomy for our subject taxon. Let's say we want to generate a taxobox for the dinosaurs, using |taxon=Dinosauria.

The template generates the taxonomy list a row at a time, starting at the bottom. It will start off by looking at the database page for our taxon, that is, "Template:Taxonomy/Dinosauria". This page contains details about the Dinosauria: the rank of the taxon, the link to display in the taxobox, and the parent taxon. Using this information, the taxobox displays the bottom row of the taxonomy.


Step three b: Generating the next row up

Example taxobox
|image=
|image caption=
التصنيف العلمي
... ...
The dinosaurs' "Parent taxon" will display here
Superorder: Dinosauria
المرادفات
|synonyms=

Once the template has completed this row, it moves up a level. But how does it know what taxon should come above the dinosaurs? This information is also stored in the database entry at "Template:Taxonomy/Dinosauria".

Step three C: Generating the rest of the taxonomy

Example taxobox
|image=
|image caption=
التصنيف العلمي
... ...
Parent taxon of "Reptilia"
Class: Reptilia
Superorder: Dinosauria
المرادفات
|synonyms=

This process continues all the way up the taxobox, until the taxonomy is complete.


Step four: Adding children

Example taxobox
|image=
|image caption=
التصنيف العلمي
Kingdom: Animalia
Phylum: Chordata
Class: Reptilia
Superorder: Dinosauria
المرادفات
|synonyms=
|subdivision ranks=

List of children to a depth of |display children=:

Once this taxonomy is complete, you can choose to display a list of child taxa. Let's set the parameter |display children=2 to see taxa ranking below the Dinosaurs. This list is generated using the same database referred to earlier.

Where to now?

Hopefully that gives you an overview of how the template works. For more detail, take a look at one of the other documentation pages: