Modul:Labelled list hatnote: Unterschied zwischen den Versionen
Modul:Labelled list hatnote (Quelltext anzeigen)
Version vom 12. Juli 2016, 04:33 Uhr
, vor 8 JahrenMoved some stuff to defaults
(Pull extraclasses and selfref from the right frame(s)) |
(Moved some stuff to defaults) |
||
Zeile 14: | Zeile 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' | |||
} | } | ||
Zeile 65: | Zeile 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, |