Jump to content

Module talk:Cite taxon

Page contents not supported in other languages.
Add topic
From Wikipedia, the free encyclopedia
Latest comment: 4 days ago by Pppery in topic Fix for BirdLife

Template-protected edit request on 25 October 2025

[edit]

@Jts1882:

The function "data.cof.checkDate" should return early if access-date is not set.

Reasoning: The current behaviour of the module in this case is to fail, which breaks a number of articles using Template:Catalog of Fishes. Examples include Acanthonus, Alphonse Guichenot, and Arctic char. If not setting access-date is an incorrect use of the template, then it should be expressed in the form of a template error.

Dieknon (talk) 22:40, 25 October 2025 (UTC)Reply

I fixed that problem. There is at least one other place where Module:Date is used and where the result should be tested to see if it is nil. There are some style issues that I could fix if wanted, starting with the trivial issue of trailing space and use of tabs for indents. Johnuniq (talk) 05:12, 26 October 2025 (UTC)Reply

Template-protected edit request on 28 April 2026

[edit]

@Jts1882:

--======================  Paleobiology Database: paleobiodb.org =======================================

data.paleobiodb = {
	citationArgs = {
		website="[[Paleobiology Database]]"
	},
	customArgs = { exclude = "id,collection,1",

Please remove 'date' from the customArgs for data.paleobiodb as per WP:AWB/Tasks. (Maybe also from the data.fossilworks?) Thanks in advance. --Namoroka (talk) 02:53, 28 April 2026 (UTC)Reply

 Done for both.  —  Jts1882 | talk  15:49, 29 April 2026 (UTC)Reply

More proper error messages?

[edit]

@Jts1882, currently there are some pages matching Special:Search/"Error: unrecognised source", for instance, yet the text is not visibly formatted as an error message, nor is there any tracking category for these errors. Module:Citation/CS1 and submodules create a red text for missing parameters, for instance, so I would expect other citation templates to do something similar. 1234qwer1234qwer4 23:20, 19 May 2026 (UTC)Reply

You are correct, the errors need formatting. I actually thought I had begun colour coding the error messages, but that must have been a different module. I've added the formatting and added a tracking category, as well as fixing the errors to those pages.  —  Jts1882 | talk  12:54, 20 May 2026 (UTC)Reply
Thanks for the quick response! 1234qwer1234qwer4 21:31, 20 May 2026 (UTC)Reply

Add SPRAT!

[edit]

Can we add SPRAT, perhaps? Functional code to do this:

Inserted after line 801 or so, after NatureServe, I put it there because SPRAT is a conservation database.

-- ============================= SPRAT =================================================
data.sprat = {
	citationArgs = {
		website="Species Profile and Threats Database",
		publisher="[[Department of Climate Change, Energy, the Environment and Water]], [[Australian Government]]",
	},
	customArgs = { 
		exclude="id,genus,species,taxon,common,1,2,3",
		baseURL = "https://www.environment.gov.au/cgi-bin/sprat/public/",
		defaultSuffix = "sprat.pl",
		defaultTitle="Species Profiles (SPRAT)",
		
	},
}

data.sprat.common = function(common) -- For use in below functions. Ensures that if and only if common is defined does a dash get added after the binomial name.
	if common then 
		return " – " .. firstToUpper(common)
	else
		return "" 
	end
end

data.sprat.species = function(genus, species)
	local title = "''" .. firstToUpper(genus) .. " " .. species .. "''" .. data.sprat.common(templateArgs['common'])
	local url = data.sprat.customArgs['baseURL'] .. "publicspecies.pl?taxon_id=" .. templateArgs['id']
	return title, url
end

data.sprat.taxon = function(taxon)
	local title = "''" .. firstToUpper(taxon) .. "''" .. data.sprat.common(templateArgs['common'])
	local url = data.sprat.customArgs['baseURL'] .. "publicspecies.pl?taxon_id=" .. templateArgs['id']
	return title, url
end

data.sprat.id = function(id)
	local title = "Species Profile (SPRAT)"
	local url = data.sprat.customArgs['baseURL'] .. "publicspecies.pl?taxon_id=" .. id
	return title, url
end

And then this little bit inserted after what is now line 2467:

if source == "SPRAT" then source = "sprat" end -- aliases

See examples at User:Maltazarian/sandbox (using Module:Sandbox/Maltazarian/Cite taxon) showing that it works. –Maltazarian ᚾparley∨investigateᛅ 12:39, 4 November 2026 (UTC)Reply

 Done @Maltazarian: I added {{cite taxon}} examples to your sandbox for testing. You can also make a {{cite SPRAT}} template as done for {{cite WFO}} and {{cite speciesfile}}.  —  Jts1882 | talk  14:09, 4 November 2026 (UTC)Reply
Thank you! –Maltazarian ᚾparley∨investigateᛅ 14:50, 4 November 2026 (UTC)Reply

Fix for BirdLife

[edit]

In the code there is currently a bit for BirdLife DataZone (line 670), but it is non-functional. It appears to have remnants of the old ID-based URL system BirdLife used for their database. They have changed over to using a combination of the common name and binomial name in the URL. This code brings makes the BirdLife part functional:

--[[  BirdLife International DataZone
      BirdLife International (2024). Species factsheet: Variable Antshrike Thamnophilus caerulescens. 
--]]

data.birdlife = {         
	citationArgs = {
		website="BirdLife DataZone", 
		publisher="[[BirdLife International]]"
	},
	customArgs = { exclude="genus,species,taxon,common,1,2,3",
	               baseURL = "https://datazone.birdlife.org/species/factsheet/",
	               defaultSuffix = "",
	               defaultTitle = "" -- No situation in which a default title makes sense (URLs formed by components also used for the title).
	               
	},
}

data.birdlife.error = function()
	return error_msg("Error: Both common (parameter 'common') and full binomial name required.") -- Without that you can't get a URL.
end

	
data.birdlife.species = function(genus, species) -- The URL parts here lowercases letters and then replaces spaces with hyphens.
	if templateArgs['common'] then
	local title = "Species factsheet:" .. " " .. firstToUpper(templateArgs['common']) .. " ''" .. firstToUpper(genus) .. " " .. species .. "''"
	local url = data.birdlife.customArgs['baseURL'] .. string.gsub(mw.ustring.lower(templateArgs['common'] .. "-" .. genus .. "-" .. species),"%s","-")
	return title, url
	else
	return data.birdlife.error()
	end
end

data.birdlife.taxon = function(taxon)
	if templateArgs['common'] then
	local title = "Species factsheet:" .. " " .. firstToUpper(templateArgs['common']) .. " ''" .. firstToUpper(taxon) .. "''"
	local url = data.birdlife.customArgs['baseURL'] .. string.gsub(mw.ustring.lower(templateArgs['common'] .. "-" .. taxon),"%s","-")
	return title, url
	else
	return data.birdlife.error()
	end
end

This bit goes in at what is now line 2496, or at line 2519 after updating the BirdLife section.

if source == "BirdLife" then source = "birdlife" end
if source == "Birdlife" then source = "birdlife" end

See User:Maltazarian/sandbox (using Module:Sandbox/Maltazarian/Cite taxon) for examples. –Maltazarian ᚾparley∨investigateᛅ 17:19, 4 November 2026 (UTC)Reply

 Done * Pppery * it has begun... 21:14, 7 November 2026 (UTC)Reply