Module:Infobox/Widget/Sponsors: Difference between revisions

From TwogPedia
No edit summary
No edit summary
Line 8: Line 8:
         local sponsor = mw.html.create('div')
         local sponsor = mw.html.create('div')
         :wikitext('[[' .. result.id .. ']]')
         :wikitext('[[' .. result.id .. ']]')
         if result.startRef then
         if result.startRef or result.startRefName then
         local startRefName = result.startRefName or ''
         local startRefName = result.startRefName or ''
        local startRef = result.startRef or ''
         sponsor:wikitext(frame:preprocess('<ref name='.. startRefName .. '>' ..result.startRef .. '</ref>'))
         sponsor:wikitext(frame:preprocess('<ref name='.. startRefName .. '>' ..result.startRef .. '</ref>'))
         end
         end

Revision as of 09:07, 23 December 2022

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

local Sponsors = {}

function Sponsors.make(results, frame)
	local container = mw.html.create('div')

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

	return container
end

return Sponsors