Module:Room features: Difference between revisions
Jump to navigation
Jump to search
Content added Content deleted
No edit summary |
No edit summary |
||
Line 13: | Line 13: | ||
} |
} |
||
function base_query(location |
function base_query(location) |
||
local ret = { |
|||
'[[Has subobject::<q>[[Located in::' .. location .. ']]</q>]]', |
'[[Has subobject::<q>[[Located in::' .. location .. ']]</q>]]', |
||
'[[Category:' .. category, |
|||
'?#-', |
'?#-', |
||
'?Name', |
'?Name', |
||
'?Image#-' |
'?Image#-' |
||
} |
} |
||
⚫ | |||
table.insert(ret, string.format('?Category:%s=%s', cat, cat)) |
|||
end |
|||
return ret |
|||
end |
end |
||
Line 28: | Line 31: | ||
local location = args[1] or mw.title.getCurrentTitle() |
local location = args[1] or mw.title.getCurrentTitle() |
||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
local results_by_type = {} |
|||
⚫ | |||
⚫ | |||
⚫ | |||
for _,cat in ipairs(categories) do |
|||
⚫ | |||
if i == 1 then |
|||
⚫ | |||
results_by_type[cat] = {} |
|||
⚫ | |||
end |
|||
⚫ | |||
if v[cat] == true then |
|||
table.insert(results_by_type[cat], v) |
|||
end |
|||
end |
|||
end |
|||
for cat,v in pairs(results_by_type) do |
|||
if #v > 0 then |
|||
⚫ | |||
⚫ | |||
⚫ | |||
for i,v in ipairs(query or {}) do |
|||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
end |
end |
||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
end |
end |
||
end |
end |
||
return ret |
return frame:preprocess(ret) |
||
end |
end |
||