Module:Room features: Difference between revisions

Jump to navigation Jump to search
Content added Content deleted
No edit summary
No edit summary
Line 16: Line 16:
return {
return {
'[[Has subobject::<q>[[Located in::' .. location .. ']]</q>]]',
'[[Has subobject::<q>[[Located in::' .. location .. ']]</q>]]',
'category=' .. category,
'[[Category:' .. category,
'?#-',
'?#-',
'?Name',
'?Name',
Line 29: Line 29:
for _,cat in ipairs(categories) do
for _,cat in ipairs(categories) do
ret = ret .. '===' .. cat .. '===\n'
local query = mw.smw.ask(base_query(location, cat))
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
end
gallery = gallery .. '</gallery>\n'
ret = ret .. frame:preprocess(gallery)
end
end
return ret
end
end