Changes
Module:Labelled list hatnote (view source)
Revision as of 01:46, 16 October 2021
, 01:46, 16 October 2021Enhanced with the ability to vary the label based on the namespace(s) of the target page(s), from sandbox
local labels = {frame.args[1] or defaults.label}
local labels = {frame.args[1] or defaults.label}
labels[2] = frame.args[2] or labels[1]
labels[2] = frame.args[2] or labels[1]
labels[3] = frame.args[3] --no defaulting
labels[4] = frame.args[4] --no defaulting
local template = frame:getParent():getTitle()
local template = frame:getParent():getTitle()
local args = mArguments.getArgs(frame, {parentOnly = true})
local args = mArguments.getArgs(frame, {parentOnly = true})
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
for k, v in pairs(pages) do
if mHatnote.findNamespaceId(v) ~= 0 then
label =
(
#pages == 1 and
(labels[3] or labels[1] or defaults.label) or
(labels[4] or labels[2] or defaults.label)
) or defaults.label
end
end
local text = string.format(
local text = string.format(
options.labelForm or defaults.labelForm,
options.labelForm or defaults.labelForm,