Template:Socialism/doc: Difference between revisions

m
mNo edit summary
 
(4 intermediate revisions by the same user not shown)
Line 1:
{{Documentation subpage}}
==Usage==
Marks a page as part of the history of far left thought on Civ.
 
== Usaging the Template ==
To use this template in an article, copy the template below, then paste the template into an article. Replace the "collapsed" to "uncollapsed" for the server the page has been on.
'''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]].
 
<source lang="html" style="overflow: hidden; background: unset;">
{{Socialism
|state=uncollapsed
|servername=uncollapsed
|civcraft2=collapsed
|civcraft3=collapsed
|civclassics=collapsed
|civrealms=collapsed
|civmc=collapsed
|other=collapsed
}}
</source>
</source>
 
=== State ===
"state" refers to the whole navbox, whereas the other named parameters determine the respective server.
By default the templates state is set to <code>autocollapse</code>. A navbox with <code>autocollapse</code> will start out collapsed if there are two or more collapsible elements on the same page. Otherwise, the navbox will be expanded.
It is recommended to only collapse the navbox of the server the page is on, when multiple apply or the page already has one or two more relevant navboxes it is recommended to collapse state and leave the respective server(s) uncollapsed.
To force it to always be uncollapsed simply change state to uncollapsed. '''This is ideal for most pages.'''
 
For ease of use one may copy this and add "un" in front of the relevant server to collapse
 
<source>
{{Socialism
|state=uncollapsed
}}
</source>
{{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
 
Example of state being uncollapsed while 2 servers are collapsed:
<source lang="html" style="overflow: hidden; background: unset;">
{{Socialism
|state=collapseduncollapsed
|civcraft2=collapsed
|civcraft3=uncollapsed
Line 35 ⟶ 38:
|civrealms=uncollapsed
|civmc=collapsed
|civreign=uncollapsed
|other=collapsed
}}
</source>
 
{{Socialism
|state=collapseduncollapsed
|civcraft2=collapsed
|civcraft3=uncollapsed
Line 46 ⟶ 49:
|civrealms=uncollapsed
|civmc=collapsed
|civreign=uncollapsed
|other=collapsed
}}
 
 
'''A more normal usecase would be the following,''' choosing only to display civrealms:
 
<source lang="html" style="overflow: hidden; background: unset;">
{{Socialism
|state=uncollapsed
|civrealms=uncollapsed
}}
</source>
{{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:
 
<source lang="html" style="overflow: hidden; background: unset;">
{{Socialism
|state=collapsed
|civrealms=uncollapsed
}}
</source>
{{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 <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
|state=uncollapsed
|civcraft2=uncollapsed
|civcraft3=uncollapsed
|civclassics=uncollapsed
|civrealms=uncollapsed
|civmc=uncollapsed
|civreign=uncollapsed
|other=uncollapsed
}}
411

edits