Module:Room features: Difference between revisions

no edit summary
No edit summary
No edit summary
Line 16:
return {
'[[Has subobject::<q>[[Located in::' .. location .. ']]</q>]]',
'category=[[Category:' .. category,
'?#-',
'?Name',
Line 29:
for _,cat in ipairs(categories) do
ret = ret .. '===' .. cat .. '===\n'
local query = mw.smw.ask(base_query(location, cat))
if query ~= nil then
ret = ret .. '===' .. cat .. '===\n'
local gallery = '<gallery>\n'
for i,v in ipairs(query or {}) do
local gallery = '<gallery>\n'
gallery = gallery .. (v.Image or 'File:Section anchor light.svg') .. '|' .. '[[' .. v[1] .. '|' .. v.Name .. ']]\n'
for i,v in ipairs(query or {}) do
gallery = gallery .. (v.Image or 'File:Section anchor light.svg') .. '|' .. '[[' .. v[1] .. '|' .. v.Name .. ']]\n'
end
gallery = gallery .. '</gallery>\n\n'
mw.log(gallery)
ret = ret .. frame:preprocess(gallery)
end
gallery = gallery .. '</gallery>\n'
ret = ret .. frame:preprocess(gallery)
end
return ret
end