Toggle menu
Toggle personal menu
Not logged in
Your IP address will be publicly visible if you make any edits.

Module:Infobox producer

From Sekaipedia

Documentation for this module may be created at Module:Infobox producer/doc

--------------------------
-- Module for [[Template:Infobox song]]
------------------------
local getArgs        = require('Module:Arguments').getArgs
local InfoboxBuilder = require('Module:InfoboxBuilder')
local DisplayFns     = require('Module:DisplayFunctions')
local ProcessingFns  = require('Module:ProcessingFunctions')
local constants      = require('Module:Constants')
local VariablesLua = mw.ext.VariablesLua

local p = {}

function p.main(frame)
	local args = getArgs(frame)
	local infobox = InfoboxBuilder.new();
	
	infobox:setName('Infobox producer')
		:setParams{
			{ name = 'producer name', default = mw.title.getCurrentTitle().text },
			{ name = 'producer image' },
			{ name = 'japanese' },
			{ name = 'romaji' },
			{ name = 'english' },
		}
		:setArgs(args)
		:processArgs()

	infobox
		:addHeader({ tag = 'argth', content = 'producer name' })
		:addImage({
			{ 
				tag = 'argtd',
				content = 'producer image',
				fn = DisplayFns.image('220px'),
				tabName = 'Original'
			}
		})
		:addRow(
			{
				{ tag = 'th', content = 'Japanese' },
				{ tag = 'argtd', content = 'japanese' }
			},
			{ hideIfEmpty = { 'japanese' } }
		)
		:addRow(
			{
				{ tag = 'th', content = 'Romaji' },
				{ tag = 'argtd', content = 'romaji' }
			},
			{ hideIfEmpty = { 'romaji' } }
		)
		:addRow(
			{
				{ tag = 'th', content = 'English' },
				{ tag = 'argtd', content = 'english' }
			},
			{ hideIfEmpty = { 'english' } }
		)
	
	local categories = ""
	if mw.title.getCurrentTitle().namespace == 0 then
		categories = "[[Category:Producers]]" .. infobox:getCategories()
	end

	return infobox:tostring() .. categories
end

return p
Cookies help us deliver our services. By using our services, you agree to our use of cookies.