mNo edit summary |
mNo edit summary |
||
Line 1: | Line 1: | ||
==Description== | ==Description== | ||
{{BadgeListNavbar}} | |||
Formats the table entries in subpages of [[YNOproject:Badges]], useful as it creates badge subobjects that point a "Badge/Location" property to any locations the badge appears in. Also creates other properties that may be useful.<br>Technically there is no use for the template for YNOproject badges since they never have a location attached to them. You can still use it to auto-format the table row if you wish, but it's best to substitute the template then remove the subobject code, as that way you avoid lag. | Formats the table entries in subpages of [[YNOproject:Badges]], useful as it creates badge subobjects that point a "Badge/Location" property to any locations the badge appears in. Also creates other properties that may be useful.<br>Technically there is no use for the template for YNOproject badges since they never have a location attached to them. You can still use it to auto-format the table row if you wish, but it's best to substitute the template then remove the subobject code, as that way you avoid lag. | ||
==Syntax== | ==Syntax== | ||
Line 58: | Line 59: | ||
==Parameters== | ==Parameters== | ||
<templatedata>{ "description": "","params": { | <templatedata>{ "description": "","params": { | ||
"id": { | |||
"label": "Badge ID", | |||
"type": "line", | |||
"description": "The id of the badge, taken from https://github.com/ynoproject/ynobadges/tree/master/badges. Do not include the filename.", | |||
"required": true, | |||
"example": "akako" | |||
}, | |||
"type": { | "type": { | ||
"label": "Badge Namespace", | "label": "Badge Namespace", | ||
Line 64: | Line 72: | ||
"description": "The wiki namespace the badge belongs to, which is used to format the wikilinks for the ''Location'' field. The location column is also removed if the namespace is set to YNOproject.", | "description": "The wiki namespace the badge belongs to, which is used to format the wikilinks for the ''Location'' field. The location column is also removed if the namespace is set to YNOproject.", | ||
"example": "Yume 2kki", | "example": "Yume 2kki", | ||
" | "autovalue": "{{SUBPAGENAME}}", | ||
"suggested": true | |||
" | |||
}, | }, | ||
"Icon": { | "Icon": { | ||
Line 162: | Line 164: | ||
| style="text-align: center;" |<u>'''Author(s)'''</u> | | style="text-align: center;" |<u>'''Author(s)'''</u> | ||
| style="text-align: center;" |<u>'''Release batch/Date'''</u> | | style="text-align: center;" |<u>'''Release batch/Date'''</u> | ||
|- | |||
|- | |- | ||
{{#if:fc_moai||! colspan="{{#ifeq:Yume Nikki|YNOproject|7|8}}" {{!}}BELOW BADGE MISSING ID - PLEASE ADD | {{#if:fc_moai||! colspan="{{#ifeq:Yume Nikki|YNOproject|7|8}}" {{!}}BELOW BADGE MISSING ID - PLEASE ADD | ||
{{!}}-}} | {{!}}-}} | ||
|{{#if: | |{{#if:|style="background:#{{{Icon_bg}}}" ; {{!}}}}{{#if:Nasu gold(badgeyn).gif, Nasu gold(badgeyn).png|{{#arraymap: Nasu gold(badgeyn).gif, Nasu gold(badgeyn).png|,|item|[[File:item{{!}}center{{!}}frameless]]|<br>}}|''TBA''}} | ||
|Tomb of the Moai | |{{#if:Tomb of the Moai|Tomb of the Moai|''Missing''}}{{#if:| <u>'''*'''</u>}} | ||
{{#ifeq:Yume Nikki|YNOproject||{{#if:FC Dungeon|{{!}}{{#arraymap:FC Dungeon|,|item|[[Yume Nikki:item{{!}}item]]|,\s|and}}|{{!}} style="background:#CDCDCD" ; {{!}}}}}} | {{#ifeq:Yume Nikki|YNOproject||{{#if:FC Dungeon|{{!}}{{#arraymap:FC Dungeon|,|item|[[Yume Nikki:item{{!}}{{#if:{{#pos:item|#}}|{{#sub:item|0|{{#pos:item|#}}}}: {{#sub:item|{{#expr:{{#pos:item|#}} + 1}}}}|{{#sub:item|0|-{{#expr:{{#pos:item|#}} - 1}}}}}}]]|,\s|and}}|{{!}} style="background:#CDCDCD" ; {{!}}}}}} | ||
{{#if:What a nice statue!| | |{{#if:What a nice statue!|What a nice statue!| style="background:#CDCDCD" ; {{!}}}} | ||
|Enter the moai head room in the FC Dungeon | |{{#if:Enter the moai head room in the FC Dungeon|Enter the moai head room in the FC Dungeon|''Please add the condition of this badge!''}} | ||
{{#if:| | |{{#if:|{{{Notes}}}| style="background:#CDCDCD" ; {{!}}}} | ||
|{{#arraymap:WikiOdd|,|item|item|,\s| | |{{#if:WikiOdd|{{#arraymap:WikiOdd|,|item|item|,\s|&}}|''Please add author credits!''}} | ||
|''TBA'' | |{{#if:|{{{Date}}}|{{#if:|{{{Batch}}}|''TBA''}}}} | ||
<span id="fc_moai">{{#ifeq:Yume Nikki|YNOproject|| | |||
{{#subobject:fc_moai | |||
|Badge/Icon = {{#arraymap:Nasu gold(badgeyn).gif, Nasu gold(badgeyn).png|,|item|File:item|,}}|+sep=, | |||
|Badge/Name = Tomb of the Moai | |||
|Badge/Location = {{#arraymap:FC Dungeon|,|item|Yume Nikki:{{#sub:item|0|{{#pos:item|#}}}}|,}}|+sep=, | |||
|Badge/Author = {{#arraymap:WikiOdd|,|item|item|,}}|+sep=, | |||
}} | |||
{{#if:|{{#subobject:fc_moai|Badge/Date = {{{Date}}}}}|{{#if:|{{#subobject:fc_moai|Badge/Date = {{{Batch}}}}}|}}}} | |||
{{#if:|{{#subobject:fc_moai|Badge/Is hidden = true}}}} | |||
}}</span> | |||
|} | |} | ||
The table start and end are provided, as is necessary. | The table start and end are provided, as is necessary. | ||
<noinclude>__NOTOC__ [[Category:Template Documentation]]</noinclude> | <noinclude>__NOTOC__ [[Category:Template Documentation]]</noinclude> | ||
<includeonly>__NOEDITSECTION__</includeonly> | <includeonly>__NOEDITSECTION__</includeonly> |
Revision as of 21:45, 12 July 2023
Description
Formats the table entries in subpages of YNOproject:Badges, useful as it creates badge subobjects that point a "Badge/Location" property to any locations the badge appears in. Also creates other properties that may be useful.
Technically there is no use for the template for YNOproject badges since they never have a location attached to them. You can still use it to auto-format the table row if you wish, but it's best to substitute the template then remove the subobject code, as that way you avoid lag.
Syntax
On the badge page you should already have a table that begins like this:
{| style="width: 100%;" cellspacing="0" cellpadding="4" border="1" |- | style="text-align: center;" |<u>'''Icon(s)'''</u> | style="text-align: center;" |<u>'''Name'''</u> | style="text-align: center;" |<u>'''Location'''</u> | style="text-align: center;" |<u>'''Description'''</u> | style="text-align: center;" |<u>'''Condition(s)'''</u> | style="text-align: center;" |<u>'''Note(s)'''</u> | style="text-align: center;" |<u>'''Author(s)'''</u> | style="text-align: center;" |<u>'''Release batch/Date'''</u>
The template is used after the table beginning. Here is an example input:
{{badge|type=Yume Nikki| |id = fc_moai |Icon = Nasu gold(badgeyn).gif, Nasu gold(badgeyn).png |Name = Tomb of the Moai |Location = FC Dungeon |Description = What a nice statue! |Condition = Enter the moai head room in the FC Dungeon |Author = WikiOdd }}
Each badge entry should be written in that format. Note there are more parameters that were absent in the example as they were not needed (not every field is required).
The "id" parameter is absolutely required for the template to work, however, it is hidden from the table itself.
The most important parameters for the actual function of the template are the "id" and "Location" fields, so endevour to at least add those (if available). Normal wikitext for formatting a table should still work even if it is surrounded by the badge template calls. If a badge has no "Location" field then it would be OK to use this normal wikitext as the subobject the template creates would be useless anyways if no location is specified.
After adding all badges, make sure to end the table with:
|}
Usage
The template creates a subobject with the id as a name. For example, id fc_moai
would create a subobject YNOproject:Badges/Badge List#fc_moai
. The subobject is also given properties related to the badge.
Parameters
Parameter | Description | Type | Status | |
---|---|---|---|---|
Badge ID | id | The id of the badge, taken from https://github.com/ynoproject/ynobadges/tree/master/badges. Do not include the filename.
| Line | required |
Badge Namespace | type Namespace | The wiki namespace the badge belongs to, which is used to format the wikilinks for the ''Location'' field. The location column is also removed if the namespace is set to YNOproject.
| Line | suggested |
Badge Icon(s) | Icon | The filename(s) of the badge to present in the table, without the ''File:'' prefix. If multiple, separate using commas. Note: image files on the wiki likely have different names than the files in the YNOproject github.
| File | suggested |
Badge Name | Name | The name of the badge as presented in YNOproject itself, or as found in https://github.com/ynoproject/ynobadges/blob/master/lang/en.json.
| Line | suggested |
Badge Location(s) | Location | The locations that the badge is found in, if any, without the namespace. Found on the badge (the github only provides Map IDs).
| Page name | optional |
Badge Description | Description | The description of the badge, if any. | Content | optional |
Badge Conditions | Condition | The condition of the badge, as found on the site or in https://github.com/ynoproject/ynobadges/blob/master/lang/en.json.
| Content | suggested |
Notes | Notes | Any notes you wish to give regarding the badge. For example, you can point out a game reference that you spotted in the badge description. | Content | optional |
Badge Author(s) | Author | Badge artist names. If multiple, separate using commas.
| String | suggested |
Release Date | Date | The date the badge was released, preferably in the ISO YYYY-MM-DD format. Can be found by checking the commit history on github.
| Date | suggested |
Batch Number | Batch | If there is no input for ''Date'', you can specify the batch number instead.
| Number | optional |
Hidden Badge Property | Hidden | Set to ''true'' to signify the badge is hidden. Hidden badges have unique backgrounds, give no BP, and are not counted for certain milestones.
| Boolean | optional |
Icon Background Override | Icon_bg | Set a hex code to use for the background of an ''Icon'' cell, to potentially clear any visibility issues.
| Line | optional |
Sample
The example given in "Syntax" above would produce the following output:
Icon(s) | Name | Location | Description | Condition(s) | Note(s) | Author(s) | Release batch/Date |
Tomb of the Moai | FC Dungeon | What a nice statue! | Enter the moai head room in the FC Dungeon | WikiOdd | TBA
|
The table start and end are provided, as is necessary.