Module:Param Parse: Difference between revisions

Jump to navigation Jump to search
Content added Content deleted
(exception case for variant, if it is 'N/A' then do not format as a link)
(if variant is N/A, prevent writing to SMW since the SMW parameter is of datatype page)
Line 458: Line 458:
end
end
return ('[[%s|%s]]'):format(v, name)
return ('[[%s|%s]]'):format(v, name)
end
function parse.variant_smw_func(v)
v = parse.has_content(v)
if v == 'N/A' then
return
end
return v
end
end
local function name_without_variant_category(name, variant_name)
local function name_without_variant_category(name, variant_name)
Line 510: Line 517:
name = 'variant',
name = 'variant',
func = parse.variant_category_func,
func = parse.variant_category_func,
smw_func = parse.has_content,
smw_func = parse.variant_smw_func,
smw_property = 'Variant of',
smw_property = 'Variant of',
category_incomplete = 'Needs variant'
category_incomplete = 'Needs variant'