Template:Socialism/doc: Difference between revisions

m
no edit summary
No edit summary
mNo edit summary
Line 2:
Marks a page as part of the history of far left thought on Civ.
 
== Usaging the Template ==
==Usage==
'''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.
 
Line 67:
}}
 
 
 
 
== 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 <code>group1</code>. All further lists and groups lower in the hiarchy are respectively labelled <code>group10</code>, <code>list10</code>, <code>group11</code>, <code>list11</code>. For Civcraft 3.0, we have <code>group2</code> and thus the groups one hierarchy lower are <code>group20</code>, <code>list20</code>, <code>group21</code>, <code>list21</code>, 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 <code>group16</code> for past and <code>group17</code> 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 <code>uncollapsed</code> or the default <code>collapsed</code> are given, returning 1 if <code>uncollapsed</code> and adding them all together. If the result is 0, <code>collapsed</code> is returned, if it is above 1 then the state will be <code>uncollapsed</code>.
 
 
To change a servers status move a group from Live (<code>group17</code>) to Past (<code>group16</code>). The <code>}}</code> marking the end of those 2 groups should be marked with a comment.
 
Next, go to the logic from <code>state17</code>, this may look as following and a similar, but longer, expression will be found in <code>state16</code>
 
<source lang="html" style="overflow: hidden; background: unset;">
{{#ifexpr:
{{#expr:
{{#ifeq: {{{civmc}}} | uncollapsed | 1 | 0}}
+ {{#ifeq: {{{civreign}}} | uncollapsed | 1 | 0}}
}}|uncollapsed|collapsed
}}
</source>
 
Copy the line containing the server, like <source lang="html" style="overflow: hidden; background: unset;"> + {{#ifeq: {{{civreign}}} | uncollapsed | 1 | 0}}</source> and paste it appropiately into <code>state16</code>. 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.
 
{{Socialism
411

edits