Module:Album Infobox: Difference between revisions
From NOISZ Wiki
RiceEmpress (talk | contribs) No edit summary |
RiceEmpress (talk | contribs) No edit summary |
||
| (One intermediate revision by the same user not shown) | |||
| Line 13: | Line 13: | ||
local information= | local information= | ||
{ | { | ||
{'Release date', args.releasedate }, | { 'Release date', args.releasedate }, | ||
{ 'Format(s)', args.formats }, | |||
{ 'Game(s)', args.games }, | { 'Game(s)', args.games }, | ||
{ 'Links', args.links} | { 'Links', args.links} | ||
Latest revision as of 18:50, 18 December 2025
Documentation for this module may be created at Module:Album Infobox/doc
local capiunto = require 'capiunto'
local p = {}
function p.main(frame)
local args = frame:getParent().args
local infobox = capiunto.create( {
title = args.title1 and args.title1 or tostring(mw.title.getCurrentTitle())
} )
if args.image1 and string.find(args.image1 .. "e","%p(tabber)%p") then
infobox:addImage(args.image1, args.caption)
elseif args.image1 then
infobox:addImage('[[File:' .. args.image1 .. '|300px]]', args.caption)
end
local information=
{
{ 'Release date', args.releasedate },
{ 'Format(s)', args.formats },
{ 'Game(s)', args.games },
{ 'Links', args.links}
}
for _, row in ipairs(information) do
local label, value = row[1], row[2]
if value and value ~= '' then
infobox:addRow(label, value)
end
end
return infobox
end
return p