Module:OrganizationsMap: Difference between revisions

From Wikiyouth
Created page with "local p = {} function p.main(frame) local args = frame:getParent().args local picture = 'File:Person reading a newspaper (Unsplash).jpg' if args['picture'] ~= nil and args['picture'] ~= 'File:' then picture = args['picture'] end return '100px|link=' end return p"
 
No edit summary
Line 2: Line 2:


function p.main(frame)
function p.main(frame)
   local args = frame:getParent().args
   -- local args = frame:getParent().args


   local picture = 'File:Person reading a newspaper (Unsplash).jpg'
   local ret = mw.visualdata.query( 'Organizations', '[[name::+]]', {'geolocation'}, {} )


if args['picture'] ~= nil and args['picture'] ~= 'File:'  then
  picture = args['picture']
end


   return '[[ ' .. picture .. '|100px|link=]]'
 
--  Gent, Belgie~The city Ghent~Ghent is awesome~ ~ ~Ghent
--  Brussel~The city Brussel~The capital of Belgium~ ~ ~Brussels
--  Antwerp~The city Antwerp~ ~ ~ ~Antwerp
 
 
 
   return mw.text.jsonEncode(ret)
end
end


return p
return p

Revision as of 15:24, 5 December 2024

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

local p = {}

function p.main(frame)
  -- local args = frame:getParent().args

  local ret = mw.visualdata.query( 'Organizations', '[[name::+]]', {'geolocation'}, {} )



--   Gent, Belgie~The city Ghent~Ghent is awesome~ ~ ~Ghent
 --  Brussel~The city Brussel~The capital of Belgium~ ~ ~Brussels
 --  Antwerp~The city Antwerp~ ~ ~ ~Antwerp



  return mw.text.jsonEncode(ret)
end

return p