This module is used for {{FA}}. Please see that template page for documentation.
-- This module implements {{FA}}.
local p = {}
function p.main()
-- Return the HTML for the page status indicator
local indicatorHtml = mw.getCurrentFrame():extensionTag {
name = "indicator",
content = '[[File:FA Emblem.png|link=The Sonic the Hedgehog Wiki:Featured Article|This is a Sonic the Hedgehog Wiki Featured Article]]',
args = {
name = "faImage"
}
}
-- Check if the page is in the main namespace (NAMESPACENUMBER is 0)
-- For more information, see [https://www.mediawiki.org/wiki/Help:Namespaces].
local namespace = mw.title.getCurrentTitle().namespace
-- Initialize the result with the indicator HTML
local result = indicatorHtml
-- Only add the category if the namespace is the main one.
if namespace == 0 then
result = result .. '[[Category:Featured Article]] [[Category:Pages using Lua-based templates]]'
end
return result
end
return p