I used the original faction infobox template and expanded it to make faction infobox2. Since the original code was not mine I am not claiming full credit for this template. However, I felt it was time for certain changes to the template and I will highlight those changes here.
Variables: "Alignment" can be one of these:
(this variable has not changed.)
LAWFUL
UNLAWFUL
QUASI-LEGAL
CORPORATION
INDEPENDENT
"Type" can be
(This variable is used in this version)
NPC - NPC faction
GROUP - Unofficial Player Group
OFFICIAL - Official Player Faction
Leave this variable blank if you wish to use the long Player Group or Player Faction templates.
"Recruitment" can be
(New variable)
CLOSED - will display "CLOSED"
INVITE - will display "By invitation ONLY" (new)
A link - will display "Click to join" linked to the address provided
Leave blank - the recruitment line will not appear.
New variables:
base2 - for those factions that use a secondary base of operations. Examples: "Public base of operations" or "Forward command post"
primaryID
secondaryID
IFF
tag - show off your in game faction tag, this variable should display special characters since it uses the nowiki command.
recruitment - link to your recruitment thread! Or tell everyone recruitment is closed!
NOTE: The "Server" variable was removed from this version because this wiki does not host pages for other servers.
' Wrote:look nice, but in your example, OC and OC guard are considered the same ID and not ID and secondery ID.
Yes, that is true, but I put it in the example to show how it looks. I'd actually like Blodo to change example 2 to reflect a faction on this server so it looks more relevant.
The code I'm still trying to work out is making the Identification and Primary ID lines hide when no variables in that section are used. I know I'm close to figuring it out but it's been a challenge.
I added a second example based on a GC server faction to the test page. We can later amend the template with it if we need to once everything is done.
As for hiding the whole Identification section, basically what you will need to do is wrap the whole thing up in an #if statement, the start of which should probably look roughly like this:
Code:
{{#if: {{{primaryID|}}}{{{IFF|}}} | your code }}
What this does is it evaluates one variable which has a default set to null, then evaluates the second variable which default is also set to null. This is denoted by the pipe in the variable declaration (no text after the pipe means default is null). If both variables are null, then the expression returns false and the #if statement doesn't proceed. Remember, #if always evaluates to true if the string is not empty. So you can put as many variables as you want in it and adjust behaviour accordingly. Hope that helped.
I did do one more update, and I think I'm finally calling this template finished.
"Origin" can be:
Use a House Link. example: "{{House Link | Rheinland}}" shows: (flag) Rheinland
Just use the house name. example: "Rheinland" shows: (flag) Federal Republic of Rheinland
In other words, if you enter the name of your house then the template will default to the long version of the house name just like using {{House Link | Rheinland | long}}. If you want to display the short version of the house name, continue using the ordinary House Link template on the origin line.
The template will also auto correct simple typos like using "Nomad" instead of "Nomads" while setting it into the long house link template.
I have found that one more update is warranted due to changes I'm making on the DUSA wiki. If the GC wiki team wishes to do similar changes I can import the new version.
New changes:
When NPC is used in the "Type" variable the Secondary ID output will change to display "Guard ID". This is so both the regular and Guard IDs (if there is one for the faction) can be easily linked from the NPC faction pages. If the secondaryID variable is not used then the line will not show, just like before.
Added the option to display the TOC at the bottom, only because someone seemed to like the idea enough to make a separate infobox for it. If the toc variable is not used then the Table of Contents will display, or not display, like normal.
I have started to convert NPC pages on DUSA, here is one that is finished so you can see the results: Liberty Police Incorporated