Anonymous user
Module:Shortcut: Difference between revisions
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
(add a nocat option to suppress category output) |
(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) |
||
Line 34:
end
table.insert(listItems, options.msg)
-- Exit if we have nothing to display
if
return nil
end
Line 56 ⟶ 55:
-- Shortcut heading
local shortcutHeading
do
cfg['shortcut-heading'],▼
local nShortcuts = #shortcuts
if nShortcuts > 0 then
):plain()▼
▲ cfg['shortcut-heading'],
nShortcuts
shortcutHeading = frame:preprocess(shortcutHeading)
shortcutHeading = shortcutHeading .. '\n'
end
end
-- Shortcut box
Line 79 ⟶ 85:
:tag('small')
:wikitext(shortcutHeading)
:tag('ul')
for i, item in ipairs(listItems) do
|