(Created page with "local getArgs = require('Module:Arguments').getArgs local News = require('Module:NewsItem') local cargo = mw.ext.cargo local limit = 100000 local LocationsList = {} function LocationsList.main(frame) local args = getArgs(frame) local results = query( args) if #results > 0 then local container = mw.html.create('div'):attr('id', 'locations-search-container') local ul = mw.html.create('ul') for r = 1, #results do ul:node(mw.html.create('li'):node('[['...") |
mNo edit summary |
||
Line 1: | Line 1: | ||
local getArgs = require('Module:Arguments').getArgs | local getArgs = require('Module:Arguments').getArgs | ||
local cargo = mw.ext.cargo | local cargo = mw.ext.cargo | ||
Revision as of 21:54, 13 March 2024
Documentation for this module may be created at Module:Locations/Full list/doc
local getArgs = require('Module:Arguments').getArgs
local cargo = mw.ext.cargo
local limit = 100000
local LocationsList = {}
function LocationsList.main(frame)
local args = getArgs(frame)
local results = query( args)
if #results > 0 then
local container = mw.html.create('div'):attr('id', 'locations-search-container')
local ul = mw.html.create('ul')
for r = 1, #results do
ul:node(mw.html.create('li'):node('[[' .. results[r]._pageName .. ']]'))
end
container:node(ul)
return container
end
end
function query(args)
local whereStr = ''
local tables = 'Locations'
local fields = '_pageName'
local cargoArgs = {
where = whereStr,
orderBy = '_pageName DESC',
limit = limit
}
local results = cargo.query(tables, fields, cargoArgs)
return results
end
return LocationsList