Site notice |
---|
Welcome! Please check To-Do List to see what pages need help, who is working on what, etc.
|
Module:Header
From Mega Man Wiki
Documentation for this module may be created at Module:Header/doc
local p = {} --p stands for package
function p.header(frame)
-- A passthrough that gets args from the frame and all
mArguments = require('Module:Arguments')
args = mArguments.getArgs(frame)
return p._header(args)
end
function p._header(args, options)
if mw.site.namespaces ~= 100 then
gallery_text = "[[" .. mw.site.text .. "|Gallery]]"
else
gallery_text = "Gallery"
end
if mw.site.namespaces ~= 14 then
category_text = "[[" .. mw.site.text .. "|Category]]"
else
category_text = "Category"
end
if mw.site.namespaces ~= 1 then
article_text = "[[" .. mw.site.text .. "|Article]]"
else
article_text = "Article"
end
local article_cell = mw.html.create( 'td' )
:css( 'width', '33%' )
:wikitext( article_text )
local series_cell = mw.html.create( 'td' )
:wikitext( category_text )
local next_cell = mw.html.create( 'td' )
:css( 'width', '33%' )
:wikitext( gallery_text )
local row = mw.html.create( 'tr' )
:wikitext( tostring(article_cell) .. tostring(category_cell) .. tostring(gallery_cell) )
local t = mw.html.create( 'table' )
t:addClass( "wikitable")
t:css( 'width', '100%' )
t:wikitext( tostring(row) )
return tostring( t )
end
return p