▶️
Planeshift.
The documentation for this module can be found at Template:Team icon.
You may be forwarded to another wiki language, in case a translation is not available.
local p = {}
function p.main( frame )
local args = frame:getParent().args
return p._main( args )
end
function p._main( args )
local image = 'File:Team icon ' .. args[1] .. '.png'
if pcall( p.cargo, args[1], 'icon' ) then
image = p.cargo( args[1], 'icon' )
elseif mw.title.new( image ).fileExists == false then
image = 'File:Team icon Default.png'
end
local size = args[2] or '40px'
return '[[' .. image .. '|' .. size .. '|link=' .. args[1] .. ']]'
end
function p.cargo( page, property )
return cargo.query( 'professional_teams', 'CONCAT(' .. property .. ')', { where='_pageName="' .. page .. '"', groupBy='_pageID' } )[1]['CONCAT(' .. property .. ')']
end
return p