Module:Message box: Difference between revisions

add class using template name, code requested by User:SD0001
(ony load Category handler when needed, requested on talk page)
(add class using template name, code requested by User:SD0001)
Line 160:
-- Add attributes, classes and styles.
self.id = args.id
self.name = args.name
if self.name then
self:addClass('box-' .. string.gsub(self.name,' ','_'))
end
if yesno(args.plainlinks) ~= false then
self:addClass('plainlinks')
Line 185 ⟶ 189:
and cfg.templateCategoryRequireName
then
self.name = args.name
if self.name then
local templateName = mw.ustring.match(
Line 197 ⟶ 200:
and mw.title.equals(self.title, self.templateTitle)
end
 
-- Process data for collapsible text fields. At the moment these are only
-- used in {{ambox}}.
Line 280 ⟶ 283:
end
if date then
self.date = string.format(" <small class='date-container'>''(<span class='date'>%s</span>)''</small>", date)
end
self.info = args.info
Anonymous user