Module:Affiliation

Revision as of 08:52, 5 November 2024 by ESUFranchise (talk | contribs) (Created page with "local p = {} local affiliationData = mw.loadData('Module:Affiliation/data') local noArgMsg = '<span style="color: #ff0000">No argument provided.</span>' local invalidArgMsg = '<span style="color: #ff0000">Invalid argument provided.</span>' p.affiliation = function(frame) local args = frame:getParent().args if args[1] == nil then return noArgMsg .. 'Category:Pages with script errors' elseif affiliationData[args[1]] == nil then return invalidArgMsg .. '[[Cate...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

This module pulls from a list of terms to help determine affiliation data.


local p = {}

local affiliationData = mw.loadData('Module:Affiliation/data')

local noArgMsg = '<span style="color: #ff0000">No argument provided.</span>'
local invalidArgMsg = '<span style="color: #ff0000">Invalid argument provided.</span>'

p.affiliation = function(frame)
	local args = frame:getParent().args
	if args[1] == nil then
		return noArgMsg .. '[[Category:Pages with script errors]]'
	elseif affiliationData[args[1]] == nil then
		return invalidArgMsg .. '[[Category:Pages with script errors]]'
	end
    return affiliationData[args[1]]
end

return p