Module:Class mask/sandbox: Difference between revisions

Content deleted Content added
try
use false if no banner shell present
Line 199:
local success, result = get_parameter_value(target, WPBSredirects, "class", options)
return success and result
-- returns FALSE if banner shell template does not exist on page
-- returns BLANK if class parameter is not defined or is defined blank
-- otherwise returns class parameter
end
 
Line 210 ⟶ 213:
local article_class = (args.article_class~='' and args.article_class) or p.readarticleclass(title,{ignore_subtemplates=true})
article_class = article_class and p._main{article_class, ignorenamespace=args.ignorenamespace} or '' -- normalise
if article_class == '' then -- articlebanner classshell doesexists notbut no article class existdefined
if local_class == '' then -- local class also does not exist, check whether any other class parameters are defined inside the shell
local classparam = p.readarticleclass(title,{ignore_blank=true, only_subtemplates=true})
Line 217 ⟶ 220:
end
end
elseif local_class == '' or local_class == article_class then -- articlelocal class existsmatches and localarticle class matches or is blank
prefix = 'H' -- hide quality class in project banner
class = article_class
elseif (article_class == 'NA') and not isarticle(local_class) then -- article class and local class are both non-article classes
prefix = 'H'
elseelseif article_class then -- article class exists and differs from local class
prefix = 'X' -- X will indicate to meta banner that classes are different, so trigger a tracking category
end