Module:Class mask/sandbox: Difference between revisions

Content deleted Content added
title2
check article_class exists first
Line 194:
end
 
p.readarticleclass = function(page, options) -- used by p._quality and Module:Banner shell
local get_parameter_value = require("Module:Template parameter value").getValue
local WPBSredirects = {'WikiProject banner shell','WikiProject banner shell/sandbox','Bannershell','Multiple wikiprojects','Project shell','Scope shell','WPB','WPBS','WPBannerShell','WP Banner Shell','WP banner shell','WikiProjectBannerShell','WikiProjectBanner Shell','WikiProjectBanners','WikiProject BannerShell','WikiProject Banner Shell','WikiProject Banners','WikiProject Banners Shell','WikiProject Shell','WikiProject banner','WikiProject banner shell/redirect','WikiProject shell','WikiprojectBannerShell','Wikiproject banner holder','Wikiproject banner shell','Wikiprojectbanners','Wikiprojectbannershell','Wpb','Wpbannershell','Wpbsgclass'}
Line 212:
elseif args.QUALITY_CRITERIA ~= 'custom' then -- project uses standard scale and will inherit article class if needed
local article_class = (args.article_class~='' and args.article_class) or p.readarticleclass(title.prefixedText,{ignore_subtemplates=true})
article_class = article_class and p._main({article_class, ignorenamespace=args.ignorenamespace}, title) or '' -- normalise
if article_class then
if article_class == '' then -- banner shell exists but no article class defined
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.prefixedText,{ignore_blank=true, only_subtemplates=true})
if classparam == '' then -- no class parameters defined, display as globally unassessed
prefix = 'H' -- hide quality class in project banner
end
end
elseif local_class == '' or local_class == article_class then -- local class matches article class 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'
elseif article_class then else -- 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
elseif local_class == '' or local_class == article_class then -- local class matches article class 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'
elseif 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
end