Module:Category handler/doc: Difference between revisions

Content deleted Content added
Update high-risk
Line 10:
For cases where a module only needs to categorise in one of the namespaces main (articles), file (images) or category, then using this module is overkill. Instead, you can simply get a title object using [[rev:https://www.mediawiki.org/wiki/Extension:Scribunto/Lua reference manual#mw.title.getCurrentTitle#mw.title.getCurrentTitle|mw.title.getCurrentTitle]] and check the <code>nsText</code> field. For example:
<source lang="lua">
local title = mw.title.getCurrentTitle()
if title.nsText == 'File' then
-- do something