Jump to content

Module:Autotaxobox: Difference between revisions

no edit summary
(Created page with "--[[************************************************************************* This module provides support to the automated taxobox system – the templates Automatic taxobox,...")
 
No edit summary
 
Line 151: Line 151:
function l.showTaxon(frame, taxon, rank, isTopTaxon, auth, force, boldFirst, virus)
function l.showTaxon(frame, taxon, rank, isTopTaxon, auth, force, boldFirst, virus)
-- it's an error if this is the top taxon and it's not a top level taxon (e.g. "Life")
-- it's an error if this is the top taxon and it's not a top level taxon (e.g. "Life")
if isTopTaxon then
-- if showing is not already forced, force if it's a principal rank or an authority is specified
if l.topLevelTaxon(taxon) then
return '' -- don't display a top level taxon
elseif mw.title.new('Taxonomy/'..taxon, 'Template').exists then
-- taxonomy template for this taxon has no parent specified
return frame:expandTemplate{ title = 'Template:Create taxonomy', args = {taxon, msg='Taxonomy template does not specify a parent'} } .. '\n' .. TableRow
else
-- no taxonomy template for this taxon
return frame:expandTemplate{ title = 'Template:Create taxonomy', args = {taxon, msg='Missing taxonomy template'} } .. '\n' .. TableRow
end
else
-- if showing is not already forced, force if it's a principal rank or an authority is specified
force = force or frame:expandTemplate{ title = 'Template:Principal rank', args = {rank} } == 'yes' or
force = force or frame:expandTemplate{ title = 'Template:Principal rank', args = {rank} } == 'yes' or
        auth ~= ''
        auth ~= ''
Line 183: Line 172:
end
end
end
end
end
--[[========================== taxonomyList =================================
--[[========================== taxonomyList =================================
Returns the cells of the taxonomy table displayed on the right hand side of
Returns the cells of the taxonomy table displayed on the right hand side of