Module:WikiProject banner/sandbox: Difference between revisions

Content deleted Content added
moved to cfg
fall back to File-class if FM category does not exist
Line 385:
end
if not isarticle(class) then
local category_exists = function(class)
local cat = mw.title.new(cfg.quality.assessment_category:format(class, assessment_cat))
if return not (cat.exists and #cat:getContent()>0) then -- check if category exists and is not blank
end
if class=='FM' and not category_exists('FM') then
class = 'File' -- fall back to File-class if FM category does not exist
end
if not category_exists(class) then
class = 'NA' -- automatically use NA for non-article pages if category does not exist
end