Modul:Message box: Unterschied zwischen den Versionen
try testing for demospace and page params or category handler against the current title object
(rewrite with a "box" object to make the code a little less spaghetti-like) |
(try testing for demospace and page params or category handler against the current title object) |
||
| Zeile 383: | Zeile 383: | ||
-- Convert category tables to strings and pass them through [[Module:Category handler]]. | -- Convert category tables to strings and pass them through [[Module:Category handler]]. | ||
local chpage, chdemospace | |||
local currentTitle = mw.title.getCurrentTitle | |||
if self.title ~= currentTitle then | |||
chpage = self.title.prefixedText | |||
end | |||
if self.nsid ~= currentTitle.namespace then | |||
chdemospace = self.nsid | |||
end | |||
self.categories = categoryHandler{ | self.categories = categoryHandler{ | ||
main = tconcat(self.mainCats or {}), | main = tconcat(self.mainCats or {}), | ||
| Zeile 388: | Zeile 396: | ||
all = tconcat(self.allCats or {}), | all = tconcat(self.allCats or {}), | ||
nocat = args.nocat, | nocat = args.nocat, | ||
demospace = | demospace = chdemospace, | ||
page = | page = chpage | ||
} | } | ||
end | end | ||