Jump to content

Module:Good Articles

From Wikipedia, the free encyclopedia
This is an old revision of this page, as edited by Wnt (talk | contribs) at 21:41, 15 April 2014 (Roughing out an overall RD section module. I'm not sure if there are basic theoretical flaws because I'm not sure all the ways the page is used.). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.
(diff) ← Previous revision | Latest revision (diff) | Newer revision → (diff)
local p = {}

p.main = function ()
	local args = require("Module:Arguments").getArgs(frame)
	-- expect args.shortcut e.g. GA/H, args.type e.g. History, args.text a long list
	local subpage = frame:preprocess("{{SUBPAGENAME}}") -- I never did look up if there's a better way to do this...
	local header, footer, output, text = "", "", "", ""
	local shortcuts = ""
	if args and args.shortcut and subpage == args.type then
		shortcuts = frame:expandTemplate{ title = 'shortcut', args = { args.shortcut } }
		header = frame:expandTemplate{ title = 'Wikipedia:Good articles/header', args = { shortcuts = shortcuts } }
    end
    text = args.text
    footer = [===[
</div>
</div>
<!-- end of list -->]===]

    output = header .. [===[{{#ifeq: {{SUBPAGENAME}} | History |  <!-- only include header on this page -->
__NOTOC__
<div style="clear:both;">
<!-- DO NOT REMOVE THIS DIV, USED TO FORCE IE TO DISPLAY BACKGROUND FOR ARTS DIV -->
</div>
<div style="clear:both;">
<span id="History" />
<div style="padding:5px 5px 8px 5px; background-color:#66CC66; text-align:left; font-size:larger;">[[Image:Noia 64 apps kworldclock.png|22px|left]]'''History'''</div>
<div style="text-align:left;">
</div>
</div>
<div style="clear:both;" class="NavFrame">
<span id="World history"/>
<div class="NavHead" style="padding:2px 2px 2px 30px; background-color:#FFFAF0; text-align:left; font-size:larger;">[[Image:Noia 64 apps kworldclock.png |22px|left]]World history</div>
<div class="NavContent" style="text-align:left;">

==&shy;&nbsp;==]===] .. text .. footer
    return output
end

return p