Template talk:Taxobox

From Wikipedia, the free encyclopedia
  (Redirected from Template talk:Taxobox/doc)
Jump to: navigation, search

Update to taxobox colour setting[edit]

In the previous version, taxobox colours were set by taxa at different ranks/levels in a very ad hoc fashion – basically through "fixes" being successively added to the system (which was originally designed so that only kingdom/regnum set the taxobox colour, but this didn't work as modern clade-based classifications came to predominate higher levels of taxonomic hierarchies).

The current version sets the taxobox colour by looking up the hierarchy, i.e. in the reverse order that the levels/parameters would be shown in a taxobox, if all present:

  • phylum
  • unranked_phylum
  • divisio
  • unranked_divisio
  • superphylum
  • unranked_superphylum
  • superdivisio
  • unranked_superdivisio
  • subregnum
  • unranked_subregnum
  • regnum
  • unranked_regnum
  • superregnum
  • unranked_superregnum
  • domain
  • unranked_domain
  • virus_group

The first of these parameters whose value (a taxon) has an entry in {{Taxobox colour}} sets the colour of the taxobox. All levels are checked, unlike the unsystematic subset previously, and the lowest over-rides any higher up, again unlike the previous system.

Coupled with changes to the automated taxobox system (see Template talk:Automatic taxobox/Archive 13#Major rewrite of the colour setting system), manual and automatic taxoboxes should now show taxobox colour in a more consistent fashion.

Incertae sedis taxa[edit]

Incertae sedis taxa present a slight problem once multiple levels can be used to set the taxobox colour. The incertae sedis colour should only be used if the only colour setting taxa found are incertae sedis ones – if there's a colour setting taxon above an incertae sedis taxon, its colour should be used instead. Although this could be coded, it would distract from the clarity of the rest of the coding, so now the incertae sedis colour must always be added to a manual taxobox via |color_as=incertae sedis. This is not too much of a problem, as there aren't many articles with this colour at present.

Peter coxhead (talk) 10:37, 3 February 2017 (UTC)


Species are not (no longer?) rendered in italics. Z440Xeon (talk) 18:27, 27 December 2016 (UTC)

@Z440Xeon: Yes, the taxobox doesn't automatically italicize. For a species article, the genus, species and binomial parameters need to be manually italicized. The binomial parameter is automatically bolded, but not species. Formatting these consistently with the majority of species articles on Wikipedia require two ' on either side of the genus and binomial and five ' around the species. Plantdrew (talk) 19:52, 27 December 2016 (UTC)
This seems to have been a design decision from the beginning (i.e. around 2010). This template, {{Taxobox}}, calls {{Taxobox/core}}, which then uses {{Taxonomy}} to output a line for each taxon in the taxobox. If {{Taxonomy}} is called as you would expect for a species, namely with |rank=species, {{Taxonomy}} does italicize the wikilinked taxon passed to it. However, for a species it's actually called with |rank=Species/noitalics – the "noitalics" could be anything, it just stops {{Taxonomy}} treating it as a species and italicizing it.
Since manual taxoboxes with species in them now all have '' around the species name, it's too late to change. Peter coxhead (talk) 22:53, 27 December 2016 (UTC)

@Z440Xeon and Plantdrew: (plus @Smith609 and Bob the Wikipedian: as you wrote most of the code originally) it's been on my "to do" list for some time to look at this again. The code is completely illogical. Each line in a manual taxobox is output by {{Taxonomy}}, which looks at the rank for that line and adds italics if it's one of these: genus, ichnogenus, oogenus, subgenus, ichnosubgenus, oosubgenus, sectio, subsectio, series, subseries, species, ichnospecies, oospecies, subspecies, ichnosubspecies, or oosubspecies. But {{Taxobox/core}} deliberately adds the string "/noitalics" to "genus", "subgenus", "sectio", "subsectio", "series", "subseries", "species" and "subspecies" before passing it to {{Taxonomy}} so that the rank never actually matches one of those that is italicized. The "oo" and "ichno" ranks aren't handled by manual taxoboxes, so they are never passed to {{Taxonomy}}. Since {{Taxonomy}} is only called from {{Taxobox/core}}, the effect is to render the check for an italicized rank pointless, since it's never passed one. See below; now changed.

One possibility would be to change the code to pass the actual rank to {{Taxonomy}} which would then add italics to taxon names at appropriate ranks if and only if ' were not already present in the name. This would mean that existing manual taxoboxes where genus names, species names, etc. are italicized would still work, but that italics would be added if no manual formatting were already present. Would this be worth doing? Peter coxhead (talk) 10:21, 3 February 2017 (UTC)

@Peter coxhead:, apologies for my recent lack of response. It's too bad italics weren't automatically applied from the beginning. However, I'm not sure it would be worth doing them automatically now. It's fairly rare to see taxoboxes that haven't been manually italicized. I think it will be confusing if ranks are italicized whether or not any 's are present, and may lead to people inadvertently finding novel ways to break things if there isn't a bot that removes all the manual italics. For instance, I understand that having the taxobox sense whether to italicize the title is a newer feature (and which incidentally relies on manual italics), but people regularly screw it up because there's the bad example of thousands of articles with a useless repetition of the scientific name in the taxobox's name parameter, which overrides the title italics sensing. I don't know, maybe my worries are overblown. Plantdrew (talk) 02:12, 6 February 2017 (UTC)
@Plantdrew: don't apologize; I know how much good work you do on taxoboxes – I've plenty of other things to do! Sorry for the length of the reply below.
The more taxoboxes I look at, the more I see creative and innovative ways to screw them up! I think the deep issue is the philosophy with which the automated taxobox system started, namely minimizing editor input at all costs, so that parameters can be omitted and the system will attempt to determine things like the taxon name and the taxobox name from the page title, as well as whether each of the three should be italicized or not. This seems a good idea, but in practice it leads to editors assuming that the code selects the right default values, and then when it doesn't, either not checking or not knowing how to correct the wrong default.
I made some fixes to the code that sets the taxobox name in the absence of |name= recently, which I think is what you are alluding to above, but only because I discovered the previous logic was muddled: in some cases the taxobox name defaulted to the taxon and in others to the page name, when these were different. I doubt that my code covers all cases properly either, given the variety of page title possible (scientific name of the target taxon, with or without disambiguation; English name, with or without disambiguation; scientific name of a higher monotypic rank, etc.) and the variety of values of |taxon=, which can include disambiguation or a qualifier (like "/displayed" or "/?"). Again at some time we need to have a wider discussion, if enough interested editors can be found, on whether the default taxobox name should be the page title or the taxon when these are different. At present the intention of the code is to select the (undisambiguated) page title.
I have some sandbox code that will italicize in manual taxoboxes in the absence of existing quote marks, but I too have reservations on whether it is worth deploying. On the other hand, I have implemented, successfully as far as I can tell, code that does something similar for italics in taxonomy templates. This means that for the first time, the botanical section in a autotaxobox like that at Levenhookia sect. Coleostylis is displayed in accordance with the ICN, because italics in Template:Taxonomy/Levenhookia sect. Coleostylis don't get over-ridden, and hence messed up, by autotaxobox system's normal automatic italicization of ranks at genus level and below. Peter coxhead (talk) 10:50, 6 February 2017 (UTC)

I have now tidied up the illogical code explained above. It should not change the behaviour of any taxoboxes, but please revert and/or leave a message here if you notice any problems. Peter coxhead (talk) 10:01, 8 February 2017 (UTC)


Plantdrew asked in November 2016 why "varietas" wasn't allowed as a parameter. This has been on my "to-do" list since then; as no-one else has fixed it, I have just done so. Both |varietas= and |varietas_authority= are now accepted (as well as |variety= and |variety_authority=). Peter coxhead (talk) 09:58, 8 February 2017 (UTC)

Why are we suppressing the bullets in taxon lists?[edit]

Currently when species or other taxons are listed in the subdivision section using either the {{Taxon list}} or {{Species list}} templates, the HTML includes custom styles to suppress the list bullets (although the lists are still indented as if they had bullets). This makes it hard to see where one species listing ends and another begins when they wrap over multiple lines. We should either not suppress the bullets or we should remove the indenting so the lines are less likely to wrap. Any opinions on which is the better option? (The talk pages for both of those templates redirect here.) Kaldari (talk) 07:07, 12 March 2017 (UTC)

I too prefer the bullets, for the reason you give, but like the convenience of the "taxon list" family of templates. They all appear to use {{Species list/line}} to produce the "no bullets" effect. The edit that removed bullets was (as far as I can see) made in December 2011. Changing such a long-established style seems to me to require wide input via a well advertised RfC. Peter coxhead (talk) 21:02, 12 March 2017 (UTC)
A well advertised RfC??? Is there some MoS issue here or a broader family of templates that produce lists of subordinate topics without bullets? I don't understand why this would need more input than what we'd usually see here. Peter, I'm sure you're very tired of being on the hook for actually making edits to protected templates based on discussions involving 3-5 editors on this talk page (with you and I being two of them), but I'm not sure why an RfC would be needed for this. Plantdrew (talk) 03:48, 13 March 2017 (UTC)
Most subordinate taxa lists in taxoboxes don't use these templates, but the non-templated lists usually have bullets; likely because typing * is an easier way to get new lines in a list than typing out an HTML line break. I'm leaning towards including bullets. @Kaldari:, do you have some examples of wrapping over multiple lines? I know I've seen this behavior before, but I'm not quite sure how it plays out in whether to bullet or indent. Plantdrew (talk) 03:48, 13 March 2017 (UTC)
@Plantdrew: yes, I'm reluctant to agree with changing a style in existence for more than five years unless I can see there's more support than the "usual suspects", although when I've tried to get more input on changes to taxoboxes, there hasn't been much response, as you know.
One possibility is to introduce |bullets= with the initial default no. Assuming this works, we could then try to get a wider discussion on changing the default to yes. Peter coxhead (talk) 11:42, 13 March 2017 (UTC)
It looks like Smith609 originally changed the style. Perhaps they could offer an opinion. Kaldari (talk) 23:26, 17 March 2017 (UTC)
  • @Kaldari and Plantdrew: an alternative way of laying out such lists is shown by the synonym list in the taxobox at Blossfeldia. By outdenting the first line of each synonym and then indenting any wrapped text it makes the layout clearer and also uses the space in the taxobox more effectively, reducing the need for wrapping. I wonder about making this the default style in all the templates like {{Species list}}. It's a less dramatic change than introducing bullets, I think. Views? Peter coxhead (talk) 15:06, 1 April 2017 (UTC)
    • @Peter coxhead: That looks like a big improvement to me. I would support making that the default styling for all the species list templates. Kaldari (talk) 17:03, 1 April 2017 (UTC)
    • @Peter coxhead: Yes, Blossfeldia looks good. So in essence, we are talking about adopting some formatting code from {{Plainlist}} into {{Species list}} (and deprecating Plainlist for taxa lists once that formatting is adopted)? Plantdrew (talk) 04:01, 3 April 2017 (UTC)
    • @Plantdrew: yes, that's my idea. Smith609 was (?is) a master of tricky template coding, so modifying the "taxon list" family of templates isn't trivial. Also, when written in the template language, templates can only cope with a fixed number of parameters. So ideally I would start again and write the underlying code in Lua, which is then driven by the top level templates. I'll think about creating some draft versions first. Peter coxhead (talk) 12:31, 3 April 2017 (UTC)
I went ahead and implemented the changes suggested by Peter (without migrating to Lua). Hope that's OK. It seems to be working well. Kaldari (talk) 07:00, 9 April 2017 (UTC)
@Kaldari: excellent. It will be interesting to see if anyone notices! (The Lua issue actually only relates to the 'outer' templates, like {{Specieslist}}, that have a large fixed number of parameters. In principle it would be better to code these in Lua which allows an arbitrary number of parameters to be handled. But, hey, it's been working the way it is for a long time!) Peter coxhead (talk) 07:47, 9 April 2017 (UTC)

Add trend parameter[edit]

IUCN and NatureServe often provide the information of population trends and since it's always good to document everything, I guess we can accommodate one additional parameter. --QEDK () 14:47, 17 March 2017 (UTC)

I don't think this data is important enough to be in the Taxobox. We simply can't and shouldn't shoehorn every fact into the infobox. Also, populations are different from species: a widespread least concern species could be declining in parts of its range, and different populations of the same species may be experiencing opposite trends. The body of the article is the place to discuss the conservation status mentioned in the Taxobox. --Animalparty! (talk) 22:31, 17 March 2017 (UTC)
IUCN pages do contain that information though, in a generalized format and I don't see a real harm in including that information. That's all. --QEDK () 04:56, 18 March 2017 (UTC)
The issue is whether it's worth including in the taxobox. They are already rather cluttered in some articles. I agree with Animalparty that this is best discussed in the text. Peter coxhead (talk) 10:53, 18 March 2017 (UTC)
I'm against including trend in the taxobox as well. There are about 800 of articles that have a (nonfunctional) |trend=. Including trend seems to be a practice that originated with PolBot and has been copied by a small number of editors in a small number of articles. I should note that I've been removing trend parameters as part of my taxobox cleanup efforts over the last 6 months; I'd estimate there were around 1200 instances of |trend= when I began with a variety of non-standardized values (e.g., decreasing, down, downward), and I've mostly focused on removing the less used variants (only "down" present now). Plantdrew (talk) 18:10, 18 March 2017 (UTC)