Template:Line-Up 2/doc

From Hattrick
< Template:Line-Up 2
Revision as of 20:57, 25 July 2010 by Jhattara (talk | contribs) (Created page with 'This template will sort your players into a nice line-up for match summaries etc.<br/> If you're experienced with mediawiki, just jump to [[{{FULLPAGENAME}}#Examples]] and then t…')
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

This template will sort your players into a nice line-up for match summaries etc.
If you're experienced with mediawiki, just jump to Template:Line-Up 2/doc#Examples and then take a look at Template:Line-Up 2/doc#Positions. That and the remark that everything you omit will be replaced by standard parameters will be enough for you.
Everyone else, rtfm and then just try on a page of your own (see sandbox) until it works ;)

ToDo: Substitutions. They should be placed under the substituted player (<br/>player credentials in the line-up). I guess this requires more suffixing, or variables with variables in them (hell, does MediaWiki know arrays? Not that we can loop here so far, but maybe soon.) If you have ideas, go for it.

Status

BETA. That means: 4-4-2 and 3-5-2 work, everything else will leave you with blank space (or exactly: nothing). You can't describe substitions directly in the template, and you have to add captaincy manually as described under Captaincy. More things to do? Do it yourself, leave me a message on my talk page or do it here; in order of speed :)
My personal page link and this paragraph will be deleted whenever the template is "finished" (nothing's ever finished!).

Usage

{{Line-Up 2/doc|system}}
where system is one out of 4-4-2, 3-5-2, and so on. If this gives no result, your formation has not yet been implemented. Then ask or do it yourself.

Then add your players:
{{Line-Up 2/doc|system|gk=Packie Bonner|gknat=IRL|gkno=1|...}}
Variables follow below. Their order is not important, it's up to you if you see through your order.

Variables

Variables always are "position" only, "position + nat" or "position + no". Thus, you only have to know the abbreviations, which follow now:

Suffixes

none Player name - leave blank if "unknown" (haha... but yes, you can leave it blank) e.g. gk
nat Player nationality, three letter abbreviation - leave blank if "unknown" (same as above) e.g. rcmnat
no the kit number of the player - leave blank if unknown/unset e.g. lfno

Positions

Priority from wing to center. That means: You'll always have a left back and a right back. With 3 defenders, the sweeper is the "central back"; with 4 defenders you'll add a left and right central back; and with 5 defenders you'll have a left and right back, a left and right central back, and a central back.

Mind that, if you set up positions that don't apply to the selected formation, they will just be ignored. If you see question marks instead of a player or players, you either have forgotten someone or entered the wrong credentials for the specific position(s).
However, this can be done itentionally. You only play with 10 players? You have no kit numbers? Leave them away, the template does work whis way, it just replaces things you don't tell it with question marks. But then you'd rather leave away positions then enter wrong ones, of course. :)

gk Goalkeeper

lb Left Back (applies in all systems)
lcb Left Central Back (4 and 5 defenders)
cb Central Back (3 and 5 defenders, the "sweeper")
rcb Right Central Back (4 and 5 defenders)
rb Right Back (applies in all systems)

lm Left Midfield (applies in all systems with more than 1 midfielder)
lcm Left Central Midfield (4 and 5 midfielders)
cm Central Midfield (1, 3 and 5 midfielders)
rcb Right Central Midfield (4 and 5 midfielders)
rm Right Midfield (applies in all systems with more than 1 midfielder)

lf Left Forward (applies in all systems with more than 1 forward)
lcf Left Central Forward (4 and 5 forwards)
cf Central Forward (1, 3 and 5 forwards)
rcf Right Central Forward (4 and 5 forwards)
rf Right Forward (applies in all systems with more than 1 forward)

sgk Substitute Goalkeeper
sb Substitute Defender (substitute "back")
sm Substitude Midfielder or Marquis de Sade
sw Substitude Wing CAUTION: Not the sweeper!
sf Substitude Forward

Captaincy?

Not yet implemented. Just do it this way:

 cm=Name goes here [[File:Captain sports.png]]|cmnat=|cmno=666

Examples

{{Line-Up 2/doc|4-4-2|gk=Goal "Goalie" Keeper|gknat=IRL|gkno=1|
  rb=Right Back|rbnat=|rbno=5|lb=Left Back|lbnat=|lbno=4|lcb=Left Central Back|lcbnat=|lcbno=3|rcb=Right Central Back|rcbnat=|rcbno=2|
  rm=Right Midfield|rmnat=|rmno=8|lm=Left Midfield|lmnat=|lmno=7|lcm=Left Central Midfield|lcmnat=|lcmno=6|rcm=Right Central Midfield|rcmnat=|rcmno=10|
  rf=Right Forward|rfnat=|rfno=9|lf=Left Forward|lfnat=|lfno=11|
  sgk=Goal Keeper|sgknat=|sgkno=12|sb=Dee Fender|sbnat=|sbno=13|
  sm=Mid L. Fielder|smnat=|smno=14|sw=Chicken Wing Midfielder|swnat=|swno=16|sf=Forward Scorer|sfno=15
}}

As you can see: I only supplied the flag for the goal keeper. You don't know something? Omit it! :) You can even leave blank everything. E.g. if you play with 10 players, omit the position you don't set up. Or write some explanative text into it. It's up to you.
And take a look at "Forward Scorer" on the bench: If you don't know the values of variables, you even don't have to write them down. I just did so for the rest of the team for explanative reasons; and don't you forget to add sfnat if you copy the text above.

Line-Up (4-4-2)
Ireland 1 Goal "Goalie" Keeper
5 Right Back 2 Right Central Back 3 Left Central Back 4 Left Back
8 Right Midfield 10 Right Central Midfield Captain sports.png 6 Left Central Midfield 7 Left Back
9 Right Forward 11 Left Forward

Bench: GK 12 Goal Keeper DF 13 Dee Fender
Bench: CM 14 Mid L. Fielder WM 16 Chicken Wing Midfielder FW 15 Forward Scorer

Some more examples, just to show how it will look like:

Line-Up (3-5-2)
1 Goal "Goalie" Keeper
5 Right Back 2 Central Back 4 Left Back
8 Right Midfield 24 Right Central Midfield 10 Central Midfield Captain sports.png 6 Left Central Midfield 7 Left Midfield
9 Right Forward 11 Left Forward

Bench: GK 12 Goal Keeper DF 13 Dee Fender
Bench: CM 14 Mid L. Fielder WM 16 Chicken Wing Midfielder FW 15 Forward Scorer


Line-Up (5-4-1)
1 Goal "Goalie" Keeper
5 Right Back 3 Right Central Back 6 Central Back Captain sports.png 2 Left Central back 4 Left Back
8 Right Midfield 10 Right Central Midfield 9 Left Central Midfield 7 Left Midfield
11 Central Forward

Bench: GK 12 Goal Keeper DF 13 Dee Fender
Bench: CM 14 Mid L. Fielder WM 16 Chicken Wing Midfielder FW 15 Forward Scorer