Module:Grid/Image list

< Module:Grid
Revision as of 08:46, 21 July 2015 by FantasyTeddy (talk | contribs) (Created page with "local p = {} function p.list( f ) local args = f.args local images = mw.text.trim( f:callParserFunction( '#dpl', { allowcachedresults = 'true', namespace = 'File', cat...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Documentation for this module may be created at Module:Grid/Image list/doc

local p = {}
function p.list( f )
	local args = f.args
	local images = mw.text.trim( f:callParserFunction( '#dpl', {
		allowcachedresults = 'true',
		namespace = 'File',
		category = ( args[1] or '' ) .. ' grid images',
		format = ',File:%TITLE%;'
	} ), ';' )
	
	local list = {}
	for image in mw.text.gsplit( images, ';' ) do
		local link = image:match( ' (.+)%.' )
		
		table.insert( list, '<li>[[' .. image .. ']] [[' .. link .. ']]</li>' )
	end
	
	return '===' .. ( args[2] or '[[' .. args[1] .. ']]' ) .. '===' ..
		'\n<ul style="-moz-columns:250px;-webkit-columns:250px;columns:250px;-moz-column-rule:2px inset #000;-webkit-column-rule:2px inset #000;column-rule:2px inset #000">\n' ..
		table.concat( list, '\n' ) ..
		'\n</ul>'
end
return p
Cookies help us deliver our services. By using our services, you agree to our use of cookies.

Need wiki hosting?

Do you need a wiki for your Minecraft mod/gaming wiki? We'll host it for free! Contact us.

Other wikis

Indie-game wikis
Powered by Indie Wikis