Module:Shortcut: Difference between revisions

From Test Wiki
67 bytes added ,  15 December 2014
add a nocat option to suppress category output
(calculate the number of list items based on a table of list items, rather than doing it ad hoc from the shortcuts plus whatever else we want to add)
(add a nocat option to suppress category output)
Line 5: Line 5:


-- Load required modules
-- Load required modules
local yesno = require('Module:Yesno')
local checkType = require('libraryUtil').checkType
local checkType = require('libraryUtil').checkType


Line 85: Line 86:


-- Error category
-- Error category
if shortcuts[1] then
if shortcuts[1] and not yesno(options.nocat) then
local title = mw.title.new(shortcuts[1])
local title = mw.title.new(shortcuts[1])
if not title or not title.exists then
if not title or not title.exists then
Cookies help us deliver our services. By using our services, you agree to our use of cookies.