Module:Infobox/Widget/Sponsors: Difference between revisions

From TwogPedia
(Created page with "local Sponsors = {} function Sponsors.make(sponsorArr, variant) local container = mw.html.create('div') -- :addClass('ib-sponsors') local sponsorList = mw.text.split(sponsorArr, ',') for i, v in ipairs(sponsorList) do v = mw.text.trim(v) local pageExists = mw.getCurrentFrame():callParserFunction('#ifexist', v, 'yes', 'no' ) local div = mw.html.create('div') if ( pageExists == 'yes' ) then div:wikitext('' .. v .. '') else div:wik...")
 
No edit summary
Line 1: Line 1:
local Sponsors = {}
local Sponsors = {}


function Sponsors.make(sponsorArr, variant)
function Sponsors.make(sponsorArr)
local container = mw.html.create('div')
local container = mw.html.create('div')
-- :addClass('ib-sponsors')
-- :addClass('ib-sponsors')

Revision as of 13:57, 30 August 2022

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

local Sponsors = {}

function Sponsors.make(sponsorArr)
	local container = mw.html.create('div')
			-- :addClass('ib-sponsors')
	local sponsorList = mw.text.split(sponsorArr, ',')
	
	for i, v in ipairs(sponsorList) do
		v = mw.text.trim(v)
		local pageExists = mw.getCurrentFrame():callParserFunction('#ifexist', v, 'yes', 'no' )
		local div = mw.html.create('div')
		if ( pageExists == 'yes' ) then 
			div:wikitext('[[' .. v .. '|' .. v .. ']]')
		else 
			div:wikitext(v)
		end
		container:node(div)
	end

	return container
end


return Sponsors