Difference between revisions of "Module:MonsterBox"

From Curse of Aros
Jump to: navigation, search
Line 10: Line 10:
 
td:addClass('infobox-header'):attr('colspan', '2')
 
td:addClass('infobox-header'):attr('colspan', '2')
 
:wikitext(frame.args.name)
 
:wikitext(frame.args.name)
 +
 +
--class="infobox-image" colspan="2"| [[File:{{{image}}}]]
 +
table:tag('tr'):tag('td'):addClass('infobox-image'):attr('colspan', 2)
 +
:wikitext('[[File:' .. frame.args.image .. ']]')
 
 
 
     return tostring(table)
 
     return tostring(table)

Revision as of 12:36, 11 February 2019

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

local export = {}

local pagename = mw.title.getCurrentTitle().fullText

function export.show(frame)
	local table = mw.html.create('table'):addClass('coa-infobox'):addClass('monster')
	
	-- Create header
	local td = table:tag('tr'):tag('td')
	td:addClass('infobox-header'):attr('colspan', '2')
		:wikitext(frame.args.name)
		
		--class="infobox-image" colspan="2"| [[File:{{{image}}}]]
	table:tag('tr'):tag('td'):addClass('infobox-image'):attr('colspan', 2)
		:wikitext('[[File:' .. frame.args.image .. ']]')
	
    return tostring(table)
end

return export