Jump to content

Module:Shortcut: Difference between revisions

output an error message if there is nothing to display
Enwikipedia>Mr. Stradivarius
(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)
Enwikipedia>Mr. Stradivarius
(output an error message if there is nothing to display)
Line 35:
table.insert(listItems, options.msg)
 
-- ExitReturn an error if we have nothing to display
if #listItems < 1 then
return '<strong class="error">Error: no shortcuts were specified ' ..
return nil
'and the ' .. mw.text.nowiki('|msg=') .. ' parameter was not ' ..
'set.</strong>'
end
 
Cookies help us deliver our services. By using our services, you agree to our use of cookies.