Module:Item interaction

From RuneRealm Wiki

This is the current revision of this page, as edited by Alex (talk | contribs) at 00:12, 17 October 2024 (Created page with "local p = {} function p.main(frame) local args = frame.args local itemName = args.item or '' local image = string.format('link=%s', itemName, itemName) local description = args.desc or '' return tostring(p.row(itemName, image, description)) end function p.row(name, image, description) return mw.html.create('tr') :css('text-align','center') :tag('td') :addClass('inventory-image') :wikitext(image) :done() :tag..."). The present address (URL) is a permanent link to this version.

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

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

local p = {}

function p.main(frame)
	local args = frame.args
	
	local itemName = args.item or ''
	local image = string.format('[[File:%s.png|link=%s]]', itemName, itemName)
	local description = args.desc or ''
	return tostring(p.row(itemName, image, description))
end

function p.row(name, image, description)
	return mw.html.create('tr')
	    :css('text-align','center')
	    :tag('td')
	        :addClass('inventory-image')
	        :wikitext(image)
	    :done()
	    :tag('td')
	        :css('text-align','left')
	        :addClass('item-col')
	        :wikitext(itemName)
	    :done()
	    :tag('td')
	        :wikitext(description)
	    :done()
end

return p