Module:Shortcut: Difference between revisions

From Test Wiki
158 bytes added ,  17 December 2014
output an error message if there is nothing to display
(use the number of shortcuts to generate the plural for the shortcut heading, rather than the number of list items; also, don't output the heading if we don't have any shortcuts to display)
(output an error message if there is nothing to display)
Line 35: Line 35:
table.insert(listItems, options.msg)
table.insert(listItems, options.msg)


-- Exit if we have nothing to display
-- Return an error if we have nothing to display
if #listItems < 1 then
if #listItems < 1 then
return nil
return '<strong class="error">Error: no shortcuts were specified ' ..
'and the ' .. mw.text.nowiki('|msg=') .. ' parameter was not ' ..
'set.</strong>'
end
end


Cookies help us deliver our services. By using our services, you agree to our use of cookies.