Module:Room features: Difference between revisions

Add text and category when there are no features
mNo edit summary
(Add text and category when there are no features)
Line 35:
function p._main(args)
local frame = mw.getCurrentFrame()
local ret = {}mw.html.create()
local location = args[1] or mw.title.getCurrentTitle().fullText
 
Line 53:
for cat,results in pairs(results_by_type) do
if #results > 0 then
ret
table.insert(ret, tostring(mw.html.create :tag('h3'):wikitext(header_text_override[cat] or cat)):done()
 
local gallery_lines = {}
Line 72 ⟶ 73:
end
 
table.insert(ret, tostring:node(frame:extensionTag{ name = 'gallery', content = table.concat(gallery_lines, '\n'), args = {} }))
end
end
else
ret:tag('dd')
:wikitext("''No room features found''[[Category:Empty room features]] ")
:wikitext(require('Module:Purge')._purge{ anchor = 'roomfeatures_purge', text = '(refresh)' })
:done()
end
 
return table.concat(ret, '')
end
 
1,525

edits