Star Citizen Wiki Module:Gallery


From the Star Citizen Wiki, the fidelity™ encyclopedia
Revision as of 00:13, 25 May 2021 by Alistair3149 (talk | contribs) (Force same height)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Module documentation[view][edit][history][purge]
This documentation is transcluded from Module:Gallery/doc. Changes can be proposed in the talk page.
Module:Gallery is invoked by function main is invoked by Template:Gallery.
Module:Gallery requires Module:Arguments.

Module:Gallery is a module that implements the {{Gallery}} template. Please see the template page for usage instructions.

local getArgs = require('Module:Arguments').getArgs
local p = {}
local root

function p.main(frame)
	local args = getArgs(frame)
	return p._main(args)

function p._main(args)
	local filearg = ''
	local height = '120'
	local prependarg = '[[File:'
	local apprendarg = '|center|frameless|' .. 'x' .. height .. 'px]]'
	for key,value in pairs(args) do
	    	filearg = filearg .. '<td>' .. prependarg .. args[key] .. apprendarg .. '</td>'
	root = mw.html.create('table')
			:wikitext( filearg )
	return tostring(root)

return p
Star Citizen Wiki uses cookies to keep session information and analytics to provide you a better experience.