Module:Infobox/Widget/Sponsors: Difference between revisions

From TwogPedia
No edit summary
No edit summary
Line 3: Line 3:
function Sponsors.make(results)
function Sponsors.make(results)
local container = mw.html.create('div')
local container = mw.html.create('div')
mw.log(results)
mw.logObject(results)
for r = 1, #results do
for r = 1, #results do
local result = results[r]
local result = results[r]

Revision as of 13:41, 26 September 2022

Documentation for this module may be created at Module:Infobox/Widget/Sponsors/doc

local Sponsors = {}

function Sponsors.make(results)
	local container = mw.html.create('div')
	mw.log(results)
	mw.logObject(results)
	for r = 1, #results do
		local result = results[r]
        local sponsor = mw.html.create('li')
        	:wikitext('[[' .. result._pageName .. ']]')
        if result.startRef then
        	local startRefName = result.startRefName or ''
        	sponsor:wikitext(frame:preprocess('<ref name='.. startRefName .. '>' ..result.startRef .. '</ref>'))
        end
        container:node(sponsor)
    end

	return container
end

return Sponsors