Module:Glyphs

local p = {} local cargo = mw.ext.cargo

function p.List( frame ) local args = frame.args local fieldstable = { "Name", "Icon", "Effect", "ApplicableRune", "_pageName", }   local tables = 'Glyphs' local fields = table.concat(fieldstable,",") -- optional parameters are grouped in one table -- you can omit any or all of them, except joinOn if you use more than one table local cargoquery = { where = args.where } local result = mw.ext.cargo.query( tables, fields, cargoquery )

if result[1] == nil then return args.default

elseif result[1] ~= nil then --Start the table local tbl = mw.html.create('table') tbl:addClass('wikitable sortable mw-datatable') if args.Icon ~= "hide" then tbl:tag("th"):wikitext("Icon"):done end if args.Name ~= "hide" then tbl:tag("th"):wikitext("Name"):done end if args.Effect ~= "hide" then tbl:tag("th"):wikitext("Nickname"):done end if args.ApplicableRune == "show" then tbl:tag("th"):wikitext("Applicable Rune."):done end tbl:done --Construct the rows in the table for _,row in ipairs(result) do		tr = tbl:tag("tr") if args.Icon ~= "hide" then tr:tag("td"):wikitext('') end if args.Name ~= "hide" then tr:tag("td"):wikitext( .. row.ShardName .. ):done end if args.Effect ~= "hide" then tr:tag("td"):wikitext(row.Effect):done end if args.ApplicableRune == "show" then tr:tag("td"):wikitext(row.ApplicableRune):done end end return tbl end -- . . . end return p