Difference between revisions of "Module:Message box"

Jump to navigation Jump to search
require name parameter for ambox
en>Mr. Stradivarius
(indentation tweak)
en>Mr. Stradivarius
(require name parameter for ambox)
Line 350: Line 350:


-- Add template-namespace categories.
-- Add template-namespace categories.
self.isTemplatePage = type(self.name) == 'string' and self.title.prefixedText == ('Template:' .. self.name)
if cfg.templateCategory then
if cfg.templateCategory then
if self.name then
if cfg.templateCategoryRequireName then
self.isTemplatePage = type(self.name) == 'string' and self.title.prefixedText == ('Template:' .. self.name)
if self.isTemplatePage then
if self.isTemplatePage then
self:addCat('template', cfg.templateCategory)
self:addCat('template', cfg.templateCategory)
Line 367: Line 367:
if not self.name and not self.title.isSubpage then
if not self.name and not self.title.isSubpage then
templateCat = templateErrorCategory
templateCat = templateErrorCategory
elseif type(self.name) == 'string' and self.title.prefixedText == ('Template:' .. self.name) then
elseif self.isTemplatePage then
local paramsToCheck = cfg.templateErrorParamsToCheck or {}
local paramsToCheck = cfg.templateErrorParamsToCheck or {}
local count = 0
local count = 0
Anonymous user

Navigation menu