Module:SMW

From devsummit
Revision as of 08:44, 27 November 2017 by Ccicalese (talk | contribs)

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

-- Module:SMW
local p = {}

-- Return results
function p.sessionTable(frame)

    local queryResult = mw.smw.getQueryResult( "[[Category:Sessions]]" )

    if queryResult == nil then
        return "(no values)"
    end

    if type( queryResult ) ~= "table" then
        return "(invalid query result)"
    end
    
    local myResult = ""
    for k,v in pairs( queryResult.results ) do
        myResult = myResult .. "[[" .. v.fulltext .. "]]" .. "<br/>"
    end

    return myResult
end

return p