Module:Labelled list hatnote: Difference between revisions
Jump to navigation
Jump to search
Content added Content deleted
(Pull extraclasses and selfref from the right frame(s)) |
(Moved some stuff to defaults) |
||
Line 14: | Line 14: | ||
-- Defaults global to this module |
-- Defaults global to this module |
||
local defaults = { |
local defaults = { |
||
label = 'See also' --Final fallback for label argument |
label = 'See also', --Final fallback for label argument |
||
labelForm = '%s: %s', |
|||
template = 'Module:Labelled list hatnote' |
|||
} |
} |
||
Line 65: | Line 67: | ||
return mHatnote.makeWikitextError( |
return mHatnote.makeWikitextError( |
||
'no page names specified', |
'no page names specified', |
||
(options.template or |
(options.template or defaults.template) .. '#Errors', |
||
options.category |
options.category |
||
) |
) |
||
end |
end |
||
label = (#pages == 1 and labels[1] or labels[2]) or defaults.label |
label = (#pages == 1 and labels[1] or labels[2]) or defaults.label |
||
local text = string.format( |
local text = string.format( |
||
options.labelForm or defaults.labelForm, |
|||
label, |
|||
mHatlist.andList(pages, true) |
|||
) |
|||
local hnOptions = { |
local hnOptions = { |
||
extraclasses = options.extraclasses, |
extraclasses = options.extraclasses, |