The Wiki for Tale 8 is in read-only mode and is available for archival and reference purposes only. Please visit the current Tale 11 Wiki in the meantime.

If you have any issues with this Wiki, please post in #wiki-editing on Discord or contact Brad in-game.

Template:Level

From A Wiki in the Desert
Revision as of 14:51, 4 March 2018 by Wyphy (talk | contribs) (Okay, fixed so it doesn't break the user page (I hope))
Jump to navigation Jump to search


In the user namespace this template hilights the level requirements of a building/test/skill/tech depending on whether the user meets them or not. Elsewhere it simply prints the level requirements in plain black.

Warning

This is a monster template! Edit, or even view the code at your own risk! -- You have been warned! :D

I know it could be simplyfied by splitting it into two or more templates, but then there would be many templates whereas now there is only this one.

Usage

In order for this template to work, it has to know your level. This is achieved by declaring the Level property on your main page, like this:

Note also that this template does not color text on pages outside the User: namespace. Please still use it on main wiki pages, though, so people can copy and paste source text to their user pages, where it will show colors.

Avatar Name: whatever
Level: [[level::21]]
Residence: somewhere in Egypt

Once you have this property, you can use this template on any of your pages. The template also supports multiple levels up to 7.


So, for example, if you want to have a list of skills on your pages, you could write the following:

* [[Mechanics]] ''(level 8)''
* [[Salvage Techniques]] ''(level 1, 4, 7, 14, 21, 28, 35)''
* [[Silkworm Farming]] ''(level 28)''

which would look like this:


If you apply the template to this code like this:

* [[Mechanics]] {{Level|8}}
* [[Salvage Techniques]] {{Level|1|4|7|14|21|28|35}}
* [[Silkworm Farming]] {{Level|28}}

you would get a result similar to what you see here:

(Provided you already declared the level property on your main user page, and your level is somewhere between 8 and 14.)


The template checks the namespace and if it is included into the user namespace, it checks the level property. If either of these checks fail, the level values will be displayed in plain black. This way the template can be included on the main wiki pages without changing them in any way. This is good because if you copy, say, a list of tests from a page all about tests, the template could have already been included there, so you won't have to edit every line.

Detailed Syntax and Output

Code Output
(Level=1)
Output
(Level=5)
Output
(Level=10)
No Level or
outside User: namespace
{{Level}} (level ?) (level ?) (level ?) (level ?)
{{Level|1}} (level 1) (level 1) (level 1) (level 1)
{{Level|4}} (level 4) (level 4) (level 4) (level 4)
{{Level|8}} (level 8) (level 8) (level 8) (level 8)
{{Level|12}} (level 12) (level 12) (level 12) (level 12)
{{Level|15+}} (level 15+) (level 15+) (level 15+) (level 15+)
{{Level|15-18}} (level 15-18) (level 15-18) (level 15-18) (level 15-18)
{{Level|foo}} (level foo) (level foo) (level foo) (level foo)
{{Level|3|6|9}} (level 3, 6, 9) (level 3, 6, 9) (level 3, 6, 9) (level 3, 6, 9)
{{Level|2|6|foo}} (level 2, 6, foo) (level 2, 6, foo) (level 2, 6, foo) (level 2, 6, foo)
{{Level|2|foo|6}} (level 2, foo, 6) (level 2, foo, 6) (level 2, foo, 6) (level 2, foo, 6)
{{Level|8|6|4|2|0|-2|-4|-6}} (level 8, 6, 4, 2, 0, -2, -4) (level 8, 6, 4, 2, 0, -2, -4) (level 8, 6, 4, 2, 0, -2, -4) (level 8, 6, 4, 2, 0, -2, -4)
{{Level|above 20? must check.}} (level above 20? must check.) (level above 20? must check.) (level above 20? must check.) (level above 20? must check.)