×
Create a new article
Write your page title here:
We currently have 3,036 articles on YumeWiki. Type your article name above or click on one of the titles below and start writing!



YumeWiki
3,036Articles

Template:Badge/doc: Difference between revisions

(update doc)
 
(17 intermediate revisions by the same user not shown)
Line 1: Line 1:
{{PropertySetting}}
==Description==
==Description==
<!--Short summary of what the main function of the template is-->
{{BadgeListNavbar}}
Formats the table entries in [[YNOproject:Badges/Badge List]], 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 in the section for YNOproject badges since they never have a location attached to them.
This template formats the table entries in subpages of [[YNOproject:Badges]]. Besides adding markup and tags, it creates badge subobjects with a [[Property:Badge/Location|"Badge/Location"]] property that interacts with each [[:Category:Locations|location]] the badge appears in.
==Syntax==
 
On the badge page you should already have a table that begins like this:
On the badge page you should already have a table that begins using {{T|badge/Start}}. The template is used after the table start. At the end of the last template usage, make sure to close the table with the <code><nowiki>|}</nowiki></code> table end.
<pre><nowiki>{| style="width: 100%;" cellspacing="0" cellpadding="4" border="1"
 
The "id" parameter is '''absolutely required''' for the template to work. However, it is hidden from the table itself, only present as a title when hovering over the badge name (or tapping on mobile). The most important parameters for the intended function of the template are the "id" and "Location" fields, so endevour to at least add those if possible.
 
==Usage==
The template creates a subobject with the id as a name. For example, using the template with {{para|id|fc_moai}} in page <code>YNOproject:Badges/Yume Nikki</code> would create the subobject <code>YNOproject:Badges/Yume Nikki#fc_moai</code>. The subobject is also given properties related to the badge.
 
{| class="wikitable"
|+Semantic properties
|-
!Property
!Function
!Datatype
|-
|[[Property:Badge/Author|Badge/Author]]
|Each author for a badge is listed as a value of this property.
|Text
|-
|[[Property:Badge/BP|Badge/BP]]
|The number of Badge Points the badge awards.
|Number
|-
|[[Property:Badge/Batch|Badge/Batch]]
|The batch the badge was released in, taken from the [https://github.com/ynoproject/ynobadges/commits/master ''ynobadges'' commits page].
|Number
|-
|[[Property:Badge/Condition|Badge/Condition]]
|The condition string of the badge, including any wiki markup.
|Text
|-
|[[Property:Badge/Date|Badge/Date]]
|The date on which the badge was added to ''ynobadges'': this may not be the day it was made available on the website. This is automatically filled in using {{t|Badge/Batch2Date}}. However, badges with batch 1 should specify date manually using {{para|Date}} in addition to the batch.
|Date
|-
|[[Property:Badge/Description|Badge/Description]]
|The description of the badge, including any wiki markup.
|Text
|-
|[[Property:Badge/Has parent|Badge/Has parent]]
|Sets to ''true'' for badges with the <code>parent</code> property in YNOproject, otherwise ''false''.
|Boolean
|-
|[[Property:Badge/Has secret condition|Badge/Has secret condition]]
|Sets to ''true'' for badges with the <code>secretCondition</code> property in YNOproject, otherwise ''false''. If a badge has both <code>secretCondition</code> and <code>secret</code>, the trait should be omitted and the value would remain ''false''.
|Boolean
|-
|[[Property:Badge/Has secret map|Badge/Has secret map]]
|Sets to ''true'' for badges with the <code>secretMap</code> property in YNOproject, otherwise ''false''.
|Boolean
|-
|[[Property:Badge/ID|Badge/ID]]
|The ID of the badge, same as the subobject name.
|Text
|-
|[[Property:Badge/Icon|Badge/Icon]]
|The icon of the badge. In many cases both an animated version (.gif) and a static version (.png) as separate values.
|Page ''(in file namespace)''
|-
|[[Property:Badge/Is hidden|Badge/Is hidden]]
|Sets to ''true'' for badges with the <code>hidden</code> property in YNOproject, otherwise ''false''.
|Boolean
|-
|[[Property:Badge/Is secret|Badge/Is secret]]
|Sets to ''true'' for badges with the <code>secret</code> property in YNOproject, otherwise ''false''.
|Boolean
|-
|[[Property:Badge/Location|Badge/Location]]
|The location of the badge. Can be multiple. This lists the badge subobject as an incoming property of that location.
|Page
|-
|-
| style="text-align: center;" |<u>'''Icon(s)'''</u>
|[[Property:Badge/Name|Badge/Name]]
| style="text-align: center;" |<u>'''Name'''</u>
|The name of the badge as presented in YNOproject.
| style="text-align: center;" |<u>'''Location'''</u>
|Text
| style="text-align: center;" |<u>'''Description'''</u>
|-
| style="text-align: center;" |<u>'''Condition(s)'''</u>
|[[Property:Badge/Parent|Badge/Parent]]
| style="text-align: center;" |<u>'''Note(s)'''</u>
|The badge ID of the parent badge, which is the value of the <code>parent</code> property in YNOproject.
| style="text-align: center;" |<u>'''Author(s)'''</u>
|Text
| style="text-align: center;" |<u>'''Release batch/Date'''</u></nowiki></pre>
|-
The template is used after the table beginning. Here is an example input:
|[[Property:Is part of game|Is part of game]]
<pre><nowiki>{{badge|type=Yume Nikki|
|The game the badge is from. Taken from the type/Namespace parameter, or from the subpage name by default.
|id = fc_moai
|Text
|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
}}</nowiki></pre>
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).<br> The "id" parameter is '''absolutely required''' for the template to work, however, it is hidden from the table itself.<br>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.<br>
After adding all badges, make sure to end the table with:
<pre><nowiki>|}</nowiki></pre>
==Usage==
<!--For this section, explain what subobjects the template creates, and what they tell you-->
''TBA''
==Parameters==
==Parameters==
<templatedata>{ "description": "","params": {
<templatedata>{
"type": {
"description": "The badge template handles both subobject data and table row presentation.",
"label": "Badge Namespace",
"format": "{{_\n|_ = _\n}}",
"aliases": ["Namespace"],
"params": {
"type": "line",
"description": "The wiki namespace the badge belongs to, which is used to format the wikilinks for the Location field. The field is also left empty if the namespace is set to YNOproject.",
"example": "Yume 2kki",
"required": true
},
"id": {
"id": {
"label": "Badge ID",
"label": "Badge ID",
"type": "line",
"type": "line",
"description": "The id of the badge, taken from https://github.com/ynoproject/ynobadges/tree/master/badges. Do not include the filename.",
"description": "The id of the badge, taken from https://github.com/ynoproject/ynobadges/tree/master/badges.",
"required": true,
"required": true
"example": "akako"
},
},
"Icon": {
"Icon": {
"label": "Badge Icon(s)",
"label": "Icon(s)",
"type": "wiki-file-name",
"type": "wiki-file-name",
"description": "The filename(s) of the badge to present in the table, without the File: prefix. If multiple, separate using commas. Note: image file on the wiki may have a different name than the file from the YNOproject github.",
"description": "The filename(s) of the badge to present in the table, without the \"File:\" prefix. If animated, put the gif first and separate using commas. Image files on the wiki usually have different names than on the YNOproject GitHub.",
"example": "Akako Gif Bdg.gif, AkakoStill Bdg.png",
"required": true
"suggested": true,
},
"default": "TBA"
"Icon_bg": {
"label": "Icon Background Override",
"type": "line",
"description": "Set a hex code to use for the background of an icon cell, to potentially clear any visibility issues."
},
},
"Name": {
"Name": {
Line 59: Line 113:
"type": "line",
"type": "line",
"description": "The name of the badge as presented in YNOproject itself, or as found in https://github.com/ynoproject/ynobadges/blob/master/lang/en.json.",
"description": "The name of the badge as presented in YNOproject itself, or as found in https://github.com/ynoproject/ynobadges/blob/master/lang/en.json.",
"example": "White Scarlet Akako",
"required": true
"suggested": true,
},
"default": "Missing"
"BP": {
"label": "BP",
"type": "number",
"description": "The number of Badge Points the badge awards."
},
"Traits": {
"label": "Traits",
"type": "line",
"description": "Any traits the badge may have, such as hidden or secret. Separate multiple traits using commas. Possible values: Is hidden, Is Secret, Has secret condition, Has secret map, Has parent.",
"example": "Has secret condition, Has secret map"
},
"Parent": {
"label": "Secret Badge Parent",
"type": "line",
"description": "The badge ID of this badge's parent, if this badge has the trait \"Has parent\"."
},
},
"Location": {
"Location": {
"label": "Badge Location(s)",
"label": "Badge Location(s)",
"type": "wiki-page-name",
"type": "wiki-page-name",
"description": "The locations that the badge is found in, if any, without the namespace. Found on the badge (the github only provides Map IDs).",
"description": "The locations that the badge is found in, if any, without the namespace. Found on the website (the GitHub only provides Map IDs)."
"example": "White Scarlet Exhibition"
},
},
"Description": {
"Description": {
"label": "Badge Description",
"label": "Description",
"type": "content",
"type": "content",
"description": "The description of the badge, if any."
"description": "The description of the badge, if any.",
"suggested": true
},
},
"Condition": {
"Condition": {
"label": "Badge Conditions",
"label": "Unlock Conditions",
"type": "content",
"type": "content",
"description": "The condition of the badge, as found on the site or in https://github.com/ynoproject/ynobadges/blob/master/lang/en.json.",
"description": "The condition of the badge, as found on the site or in https://github.com/ynoproject/ynobadges/blob/master/lang/en.json.",
"example": "Show Akako in the White Scarlet Exhibition all of the effects she likes",
"required": true
"suggested": true,
"default": "Please add the condition of this badge!"
},
},
"Notes": {
"Notes": {
Line 89: Line 155:
"Author": {
"Author": {
"label": "Badge Author(s)",
"label": "Badge Author(s)",
"type": "string",
"type": "line",
"description": "Badge artist names. If multiple, separate using commas.",
"description": "Badge artist names. If multiple, separate using the & symbol.",
"example": "Rose",
"example": "Rose",
"required": true
},
"Batch": {
"label": "Batch Number",
"type": "number",
"description": "The batch which contained the badge. Can be found in the badge file. For batch 1 badges, you may need to specify \"Date\" as well.",
"suggested": true,
"suggested": true,
"default": "Please add author credits!"
"example": "26"
},
},
"Date": {
"Date": {
"label": "Release Date",
"label": "Release Date",
"type": "date",
"type": "date",
"description": "The date the badge was released, preferably in the ISO YYYY-MM-DD format. Can be found by checking the commit history on github.",
"description": "Provide the date the badge was released if there is no batch number, or if the batch number may be inaccurate/not specific, such as for batch 1 badges.",
"example": "2023-07-08",
"example": "2022-10-05"
"suggested": true,
"default": "value for Batch"
},
"Batch": {
"label": "Batch Number",
"type": "number",
"description": "If there is no input for Date, you can specify the batch number instead.",
"example": "32",
"default": "TBA"
}}}</templatedata>
}}}</templatedata>
==Sample==
==Sample==
The example given in "Syntax" above would produce the following output:
{{badge/Start}}
{| style="width: 100%;" cellspacing="0" cellpadding="4" border="1"
|- id="white_tulip"
|-
|style="text-align:center;background:"|[[File:White tulip(badgeyn).png]]
| style="text-align: center;" |<u>'''Icon(s)'''</u>
|<span title="white_tulip" tabindex="0">Rain and Flowers</span>
| style="text-align: center;" |<u>'''Name'''</u>
|15
| style="text-align: center;" |<u>'''Location'''</u>
|class="center-text"|<span tabindex="0" title="Secret condition">🤐</span><br><span tabindex="0" title="Secret map">🗺</span><br>
| style="text-align: center;" |<u>'''Description'''</u>
|[[Yume Nikki:Sky Garden#Crossover Garden|Sky Garden: Crossover Garden]]
| style="text-align: center;" |<u>'''Condition(s)'''</u>
|class="empty"|
| style="text-align: center;" |<u>'''Note(s)'''</u>
|Visit the white tulip passage between Sky Garden and [[Yume Nikki:Ghost World|Ghost World]]
| style="text-align: center;" |<u>'''Author(s)'''</u>
|Badge name references a [https://www.youtube.com/watch?v=8ER6sXss5EU ''Yume Nikki'' remix of the same name].
| style="text-align: center;" |<u>'''Release batch/Date'''</u></nowiki></pre>
|wiki0dd
|-
|2023-12-01<br>Batch 86
{{#if:fc_moai||! colspan="{{#ifeq:Yume Nikki|YNOproject|7|8}}" {{!}}BELOW BADGE MISSING ID - PLEASE ADD
{{!}}-}}
|{{#if:MoaiStatue(badgeYN).png|{{#arraymap:MoaiStatue(badgeYN).png|,|item|[[File:item{{!}}center{{!}}frameless]]|<br>}}|''TBA''}}
|Tomb of the Moai
{{#ifeq:Yume Nikki|YNOproject||{{#if:FC Dungeon|{{!}}{{#arraymap:FC Dungeon|,|item|[[Yume Nikki:item{{!}}item]]|,\s|and}}|{{!}} style="background:#CDCDCD" ; {{!}}}}}}
{{#if:What a nice statue!|{{!}}What a nice statue!|{{!}} style="background:#CDCDCD" ; {{!}}}}
|Enter the moai head room in the FC Dungeon
{{#if:|{{!}}{{{Notes}}}|{{!}} style="background:#CDCDCD" ; {{!}}}}
|{{#arraymap:WikiOdd|,|item|item|,\s|and}}
|''TBA''
|}
|}
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>[[Category:Template documentation]]</noinclude>
<includeonly>__NOEDITSECTION__</includeonly>
<includeonly>__NOEDITSECTION__</includeonly>

Latest revision as of 03:12, 28 October 2024

Description

This template formats the table entries in subpages of YNOproject:Badges. Besides adding markup and tags, it creates badge subobjects with a "Badge/Location" property that interacts with each location the badge appears in.

On the badge page you should already have a table that begins using {{badge/Start}}. The template is used after the table start. At the end of the last template usage, make sure to close the table with the |} table end.

The "id" parameter is absolutely required for the template to work. However, it is hidden from the table itself, only present as a title when hovering over the badge name (or tapping on mobile). The most important parameters for the intended function of the template are the "id" and "Location" fields, so endevour to at least add those if possible.

Usage

The template creates a subobject with the id as a name. For example, using the template with |id = fc_moai in page YNOproject:Badges/Yume Nikki would create the subobject YNOproject:Badges/Yume Nikki#fc_moai. The subobject is also given properties related to the badge.

Semantic properties
Property Function Datatype
Badge/Author Each author for a badge is listed as a value of this property. Text
Badge/BP The number of Badge Points the badge awards. Number
Badge/Batch The batch the badge was released in, taken from the ynobadges commits page. Number
Badge/Condition The condition string of the badge, including any wiki markup. Text
Badge/Date The date on which the badge was added to ynobadges: this may not be the day it was made available on the website. This is automatically filled in using {{Badge/Batch2Date}}. However, badges with batch 1 should specify date manually using |Date = in addition to the batch. Date
Badge/Description The description of the badge, including any wiki markup. Text
Badge/Has parent Sets to true for badges with the parent property in YNOproject, otherwise false. Boolean
Badge/Has secret condition Sets to true for badges with the secretCondition property in YNOproject, otherwise false. If a badge has both secretCondition and secret, the trait should be omitted and the value would remain false. Boolean
Badge/Has secret map Sets to true for badges with the secretMap property in YNOproject, otherwise false. Boolean
Badge/ID The ID of the badge, same as the subobject name. Text
Badge/Icon The icon of the badge. In many cases both an animated version (.gif) and a static version (.png) as separate values. Page (in file namespace)
Badge/Is hidden Sets to true for badges with the hidden property in YNOproject, otherwise false. Boolean
Badge/Is secret Sets to true for badges with the secret property in YNOproject, otherwise false. Boolean
Badge/Location The location of the badge. Can be multiple. This lists the badge subobject as an incoming property of that location. Page
Badge/Name The name of the badge as presented in YNOproject. Text
Badge/Parent The badge ID of the parent badge, which is the value of the parent property in YNOproject. Text
Is part of game The game the badge is from. Taken from the type/Namespace parameter, or from the subpage name by default. Text

Parameters

The badge template handles both subobject data and table row presentation.

Template parameters

This template has custom formatting.

ParameterDescriptionTypeStatus
Badge IDid

The id of the badge, taken from https://github.com/ynoproject/ynobadges/tree/master/badges.

Linerequired
Icon(s)Icon

The filename(s) of the badge to present in the table, without the "File:" prefix. If animated, put the gif first and separate using commas. Image files on the wiki usually have different names than on the YNOproject GitHub.

Filerequired
Icon Background OverrideIcon_bg

Set a hex code to use for the background of an icon cell, to potentially clear any visibility issues.

Lineoptional
Badge NameName

The name of the badge as presented in YNOproject itself, or as found in https://github.com/ynoproject/ynobadges/blob/master/lang/en.json.

Linerequired
BPBP

The number of Badge Points the badge awards.

Numberoptional
TraitsTraits

Any traits the badge may have, such as hidden or secret. Separate multiple traits using commas. Possible values: Is hidden, Is Secret, Has secret condition, Has secret map, Has parent.

Example
Has secret condition, Has secret map
Lineoptional
Secret Badge ParentParent

The badge ID of this badge's parent, if this badge has the trait "Has parent".

Lineoptional
Badge Location(s)Location

The locations that the badge is found in, if any, without the namespace. Found on the website (the GitHub only provides Map IDs).

Page nameoptional
DescriptionDescription

The description of the badge, if any.

Contentsuggested
Unlock ConditionsCondition

The condition of the badge, as found on the site or in https://github.com/ynoproject/ynobadges/blob/master/lang/en.json.

Contentrequired
NotesNotes

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.

Contentoptional
Badge Author(s)Author

Badge artist names. If multiple, separate using the & symbol.

Example
Rose
Linerequired
Batch NumberBatch

The batch which contained the badge. Can be found in the badge file. For batch 1 badges, you may need to specify "Date" as well.

Example
26
Numbersuggested
Release DateDate

Provide the date the badge was released if there is no batch number, or if the batch number may be inaccurate/not specific, such as for batch 1 badges.

Example
2022-10-05
Dateoptional

Sample

Icon Name BP 🌟 Location Description Condition Notes Author Date/Batch
White tulip(badgeyn).png Rain and Flowers 15 🤐
🗺
Sky Garden: Crossover Garden Visit the white tulip passage between Sky Garden and Ghost World Badge name references a Yume Nikki remix of the same name. wiki0dd 2023-12-01
Batch 86

The table start and end are provided, as is necessary.