Jump to content

Module:TestModule

From NewsWikiTestbed
Revision as of 10:59, 10 June 2025 by AdamZachar (talk | contribs)

local p = {} --p stands for package

function p.hello( frame )
 return "Hello, world!"

  -- if row.shape == targetShape then
   -- output = output .. " <li>" .. "[[" .. row.shape .. "]]"
  -- end

end

function p.externalDataTest( frame )
 local output = ""
 local parentCase = frame.args.parentCase
 local topics, errors =
  mw.ext.externaldata.getDbData
  {
   source = CaseData,
   query = childrenTopics,
   data = {topicName = topic_name},
   parameters = parentCase
  }

 output = output .. "<ul>"
 for i, topic in ipairs(topics) do
  output = output .. " <li>" .. "[[" .. topic.topicName .. "]]"
 end

 output = output .. "</ul>"

 return output
end

return p