Difference between revisions of "Module:PastWikithons"

From BASAbaliWiki
(Created page with "local p = {} function p.display( frame ) return "" end return p")
 
Line 2: Line 2:
  
 
function p.display( frame )
 
function p.display( frame )
+
html = ''
     return ""
+
-- https://github.com/SemanticMediaWiki/SemanticScribunto/blob/master/docs/README.md
 +
local result = mw.smw.ask {
 +
    '[[Category:Article]]',
 +
    '[[Competition::+]]',
 +
    '?Competition',
 +
    limit = 10,
 +
    mainlabel = '-'
 +
}
 +
if result and #result then
 +
for num, entityData in pairs( result ) do
 +
html = html .. entityData['Competition']
 +
end
 +
end
 +
     return html
 
end
 
end
  
 
return p
 
return p

Revision as of 13:41, 9 July 2024

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

local p = {}

function p.display( frame )
	html = ''
	-- https://github.com/SemanticMediaWiki/SemanticScribunto/blob/master/docs/README.md
	local result = mw.smw.ask {
    	'[[Category:Article]]',
    	'[[Competition::+]]',
    	'?Competition',
    	limit = 10,
    	mainlabel = '-'
	}
	if result and #result then
		for num, entityData in pairs( result ) do
			html = html .. entityData['Competition']
		end
	end
    return html
end

return p