local p = {}
local PlatformsData = mw.loadData ( 'Module:Platforms/data' )
function p.GenerateIconReturnString (titleDesc, fileName, className) --Not to be called from wikitext
    local span = mw.html.create( 'span' )
        :attr( 'title', titleDesc) --adds title attribute with data from titleDesc
        :addClass( className) --if this variable is nil, no class is added
        :wikitext( '[[File:Icon ' .. fileName .. '.png|x15px|link=]]' ) --what's between the tags
    return tostring( span )
function p.PlatformsIcon ( frame ) -- version to be used from wikitext
    local args = frame:getParent().args --Get arguments from template
    local returnString = ''
    for _, v in ipairs(args) do --Loop through the arguments
        v = v:lower() --make argument lowercase
        if v == 'ps3' then --if v equals 'ps3' then the last parameter is given the data 'ps3icon'
            returnString = returnString .. '&nbsp;' .. p.GenerateIconReturnString(PlatformsData[v], v, 'ps3icon')
        else --else, the last parameter is nil
            returnString = returnString .. '&nbsp;' .. p.GenerateIconReturnString(PlatformsData[v], v, nil)
    return returnString
return p

Ad blocker interference detected!

Wikia is a free-to-use site that makes money from advertising. We have a modified experience for viewers using ad blockers

Wikia is not accessible if you’ve made further modifications. Remove the custom ad blocker rule(s) and the page will load as expected.