Fandom

Civilization

Module:Overview

6,977pages on
this wiki
Add New Page
Talk0

Ad blocker interference detected!


Wikia is a free-to-use site that makes money from advertising. We have a modified experience for viewers using ad blockers

Wikia is not accessible if you’ve made further modifications. Remove the custom ad blocker rule(s) and the page will load as expected.

local p = {}
 
--Data format: Template parameters, Game name, Game suffix
p.Data = {}
p.Data[1] = {"civ1", "Civilization","Civ1"}
p.Data[2] = {"civ2", "Civilization II","Civ2"}
p.Data[3] = {"civ3", "Civilization III","Civ3"}
p.Data[4] = {"civ4", "Civilization IV","Civ4"}
p.Data[5] = {"civ5", "Civilization V","Civ5"}
p.Data[6] = {"civ6", "Civilization VI","Civ6"}
p.Data[7] = {"civbe", "Civilization: Beyond Earth","CivBE"}
p.Data[8] = {"civrev", "Civilization Revolution","CivRev"}
p.Data[9] = {"civrev2", "Civilization Revolution 2","CivRev2"}
p.Data[10] = {"freeciv", "Freeciv","Freeciv"}
p.Data[11] = {"ctp1", "Civilization: Call to Power","CTP1"}
p.Data[12] = {"ctp2", "Call to Power II","CTP2"}
p.Data[13] = {"cevo", "C-evo","C-evo"}
p.Data[14] = {"col", "Colonization","Col"}
p.Data[15] = {"freecol","FreeCol","Freecol"}
p.Data[16] = {"c4c","Civilization IV: Colonization","Civ4Col"}
p.Data[17] = {"smac","Sid Meier's Alpha Centauri‎","SMAC"}
local key, name,suffix = 1,2,3
 
 
--Overview 
--Doc : http://civilization.wikia.com/wiki/Template:Overview
function p.Overview(frame)
	local args = frame:getParent().args
	local PAGENAME = mw.title.getCurrentTitle().text
	local createdpagestext = "{{tocright}}__NOEDITSECTION__"
	local missingpagestext = "\n\n==Other games==\n"..PAGENAME.." is not present in <small>(or the article has not been created for)</small> the following games :''\n\n{| border='0' cellpadding='1' cellspacing='1' class='article-table'\n!Game\n!Article\n|-"
 
	for i=1, #p.Data do
		local info = p.Data[i]
		local desc = args[info[key]]
		if not (desc and (desc == 'no')) then
			local potentialpagename = PAGENAME.." ("..info[suffix]..")"
			local potentialpage = mw.title.new( potentialpagename, 0 ) --Expensive!
			if potentialpage.exists then
				createdpagestext = createdpagestext.."\n==="..info[name].."===\n{{main|"..potentialpagename.."}}\n"..(desc or "")
			elseif desc then
				createdpagestext = createdpagestext.."\n==="..info[name].."===\n:''The [["..potentialpagename.."|main article]] has not been created for <small>(or "..PAGENAME.." is not part of)</small> [["..info[name].."]]''\n"..(desc or "")
			else
				missingpagestext = missingpagestext.."\n{{!}}"..info[name].."\n{{!}}[["..potentialpagename.."]]\n{{!}}-"
			end
		end
	end
 
	local processedtext = frame:preprocess(createdpagestext..missingpagestext.."\n|}\n{{Disambig}}[[Category:Overview pages]]")
	return processedtext
end
 
return p

Also on Fandom

Random Wiki