Template:Community infobox/doc: Difference between revisions

From NPOWiki
Jump to navigation Jump to search
mNo edit summary
No edit summary
Line 20: Line 20:
*'''foundedby'''
*'''foundedby'''
*'''founded'''
*'''founded'''
*'''gov1name''' through '''gov9name''' - the heading for the matching list
*'''gov1''' through '''gov9''' - freeform area
*'''gov1''' through '''gov9''' - freeform area
*'''gov1name''' through '''gov9name''' - the heading for the matching list
*'''teamsenate''' - CN only, supported team senators
*'''teamsenate''' - CN only, supported team senators
*'''treaties''' - freeform area
*'''treaties''' - freeform area
*'''forumurl'''
*'''forumurl''' - full url
*'''discordinvite''' - full url
*'''discordinvite''' - full url
*'''ircserver''' - e.g. coldfront.net
*'''ircserver''' - e.g. coldfront.net
Line 46: Line 46:
|foundedby =  
|foundedby =  
|founded =  
|founded =  
|gov1name =
|gov1 =  
|gov1 =  
|gov1name =  
|gov2name =  
|gov2 =  
|gov2 =  
|gov2name =  
|gov3name =  
|gov3 =  
|gov3 =  
|gov3name =  
|gov4name =  
|gov4 =  
|gov4 =  
|gov4name =  
|gov5name =  
|gov5 =  
|gov5 =  
|gov5name =  
|gov6name =  
|gov6 =  
|gov6 =  
|gov6name =  
|gov7name =  
|gov7 =  
|gov7 =  
|gov7name =  
|gov8name =  
|gov8 =  
|gov8 =  
|gov8name =  
|gov9name =  
|gov9 =  
|gov9 =  
|gov9name =
|teamsenate =  
|teamsenate =  
|treaties =  
|treaties =  

Revision as of 07:59, 30 June 2020

This page contains the documentation for Template:Community infobox. It includes information about the template, such as usage and categories, and is not displayed when using the template itself.

This template is meant to be "implemented" by other templates, but can be used directly if needed. Implementations must specify the game name and pass through any relevant parameters, or custom formatted information. They must be updated if the available parameters are changed.

For a list of current implementations, see here.

Available parameters

  • game - can be one of: cybernations, nationstates, othergame (default).
  • width - of infobox; use sparingly. Currently not available in implementations.
  • name
  • acronym
  • gameid - CN only, the alliance ID in game
  • flag - file name and extension
  • flagdesc
  • flag2
  • flag2desc
  • flag3
  • flag3desc
  • team - CN only
  • foundedby
  • founded
  • gov1name through gov9name - the heading for the matching list
  • gov1 through gov9 - freeform area
  • teamsenate - CN only, supported team senators
  • treaties - freeform area
  • forumurl - full url
  • discordinvite - full url
  • ircserver - e.g. coldfront.net
  • ircchannel - no # sign
  • seealso - freeform area, intended for wikilinks only

Skeleton

{{Community infobox
|game = 
|width = 
|name = 
|acronym = 
|gameid = 
|flag = 
|flagdesc = 
|flag2 = 
|flag2desc = 
|flag3 = 
|flag3desc = 
|team = 
|foundedby = 
|founded = 
|gov1name = 
|gov1 = 
|gov2name = 
|gov2 = 
|gov3name = 
|gov3 = 
|gov4name = 
|gov4 = 
|gov5name = 
|gov5 = 
|gov6name = 
|gov6 = 
|gov7name = 
|gov7 = 
|gov8name = 
|gov8 = 
|gov9name = 
|gov9 = 
|teamsenate = 
|treaties = 
|forumurl = 
|discordinvite = 
|ircserver = 
|ircchannel = 
|seealso = 
}}

Helper

To generate code for an implementation, you can use this script in your browser console. Call it with an array of parameter names, which you can obtain from the skeleton above.

function foo(bar) {
	var out = ''
	for (var i = 0; i < bar.length; i++) {
		out += '\n|' + bar[i] + ' = {{{' + bar[i] + '|}}}';
	}
	console.log(out);
}