Template:Socialism

From CivWiki
Jump to navigation Jump to search
Template documentation[view] [edit] [history] [purge]

Marks a page as part of the history of far left thought on Civ.

Usaging the Template

TL;DR: To use this template in an article, copy the template below, paste it into an article and change servername to the respective server of the page. See below for variable names.

In case of issues, errors or you want to add things but find the template too annoying to navigate through simply contact Raven.

{{Socialism
|state=uncollapsed
|servername=uncollapsed
}}

State

By default the templates state is set to autocollapse. A navbox with autocollapse will start out collapsed if there are two or more collapsible elements on the same page. Otherwise, the navbox will be expanded. To force it to always be uncollapsed simply change state to uncollapsed. This is ideal for most pages.

{{Socialism
|state=uncollapsed
}}

Server

All servers are collapsed by default, it is intended that the respective server associated with the page is set as uncollapsed. However, you are capable of uncollapsing as many servers as you want, keep in mind that this might look bloated. The following example employs a mix of collapsed and uncollapsed servers

{{Socialism
|state=uncollapsed
|civcraft2=collapsed
|civcraft3=uncollapsed
|civclassics=collapsed
|civrealms=uncollapsed
|civmc=collapsed
|civreign=uncollapsed
|other=collapsed
}}


A more normal usecase would be the following, choosing only to display civrealms:

{{Socialism
|state=uncollapsed
|civrealms=uncollapsed
}}

Bloated Pages

Some pages may already have multiple navboxes, if you intend, for example due to the ties to socialism being rather secondary, you can collapse the general navbox while setting the specific server as uncollapsed. This will result in the specific server being visible once the general navbox is uncollapsed. An example using CivRealms:

{{Socialism
|state=collapsed
|civrealms=uncollapsed
}}



Maintaing the Template

Hierarchy

To make it easier to add things later on, the groups and lists are supposed to reflect their position in the hierarchy. This is not pursued in further nestings.

The highest relevant group, for example, Civcraft 2.0 is group1. All further lists and groups lower in the hiarchy are respectively labelled group10, list10, group11, list11. For Civcraft 3.0, we have group2 and thus the groups one hierarchy lower are group20, list20, group21, list21, etc. This may not work forever as I think there is a sort of limit to groups and would also break if one server requires more than 10 groups. So far though this has not been an issue.

The Live and Past Server group are an exception, those are group16 for past and group17 for live at the moment.

Live & Past Servers

The category live & past server are automatically collapsed and uncollapsed depending on whether an active server is collapsed or uncollapsed. This is done through checking for each server whether uncollapsed or the default collapsed are given, returning 1 if uncollapsed and adding them all together. If the result is 0, collapsed is returned, if it is above 1 then the state will be uncollapsed.


To change a servers status move a group from Live (group17) to Past (group16). The }} marking the end of those 2 groups should be marked with a comment.

Next, go to the logic from state17, this may look as following and a similar, but longer, expression will be found in state16

{{#ifexpr:
  {{#expr:
    {{#ifeq: {{{civmc}}} | uncollapsed | 1 | 0}}
  + {{#ifeq: {{{civreign}}} | uncollapsed | 1 | 0}}
  }}|uncollapsed|collapsed
}}
Copy the line containing the server, like
 + {{#ifeq: {{{civreign}}} | uncollapsed | 1 | 0}}
and paste it appropiately into state16. If there is only one active server then there shouldn't be any + as its role is to add up servers.

Read up on w:Help:Conditional_expressions for more information.