This template replaces a large switch statement on {{LEGOCite}} and converts the "theme" parameter shorthand into the appropriate formatted link to the LEGO subtheme.


local p = {}

local data = {
	headz = "[[LEGO]] [[w:c:lego:BrickHeadz|BrickHeadz]]",
	micro = "[[LEGO]] [[w:c:lego:Microfighters|Microfighters]]",
	ucs = "[[LEGO Ultimate Collector's Series]]",
}

function p.render(args)
	local theme = args.theme or ''
	local text = data[string.lower(theme)]
	if text then
		return text
	end
	return "[[LEGO|LEGO ''Star Wars'']]"
end

local getArgs = require('Module:Arguments').getArgs
function p.main(frame)
	local args = getArgs(frame)
	return p.render(args)
end

return p