Module:Infobox: Difference between revisions

From Vintage Story Wiki
mNo edit summary
mNo edit summary
Line 1: Line 1:
local p = {}
local p = {}
function p.infobox( f )
function p.infobox( f )
local args = f.args
local args = require( 'Module:ProcessArgs' ).merge( true )
local titleObject = mw.title.getCurrentTitle()
local titleObject = mw.title.getCurrentTitle()
local title = args.title or titleObject.baseText
local title = args.title or titleObject.baseText
Line 7: Line 7:
local imageString = '[[File:' .. args.image .. '.png|180px]]' -- forcing 180px as it can't seem to use the size variable
local imageString = '[[File:' .. args.image .. '.png|180px]]' -- forcing 180px as it can't seem to use the size variable
local images = {}
local images = {}
if args.images ~= nil then
if args.images then
imageString = ''
imageString = ''
for image in mw.text.gsplit( args.images, '%s*;%s*' ) do
for image in mw.text.gsplit( args.images, '%s*;%s*' ) do