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



YumeWiki
3,035Articles

Template:Badge: Difference between revisions

mNo edit summary
(use new "empty" class)
 
(45 intermediate revisions by the same user not shown)
Line 1: Line 1:
<includeonly>|-
<includeonly>|{{#if:{{{id|}}}|- id="{{{id}}}"|-
|{{#arraymap: {{{Icon}}}|,|item|[[File:item{{!}}center{{!}}frameless]]|<br>}}
!colspan="10"{{!}}BELOW BADGE MISSING ID - PLEASE ADD
|{{{Name}}}
{{!}}-}}
{{#ifeq:{{{type}}}|YNOproject||{{#if:{{{Location|}}}|{{!}}{{#arraymap:{{{Location}}}|,|item|[[{{{type|MISSING TYPE}}}:item{{!}}item]]|,\s|and}}}}}}
|style="text-align:center;background:{{{Icon_bg|}}}"|<!-- Icon_bg can customise Icon cell background -->{{#arraymap:{{{Icon}}}|,|@|[[File:@]]|<br><br>}}<!-- Format as image, separate using linebreaks -->
{{#if:{{{Description|}}}|{{!}}{{{Description}}}|{{!}} style="background:#CDCDCD" ; {{!}}}}
|<span title="{{{id|Unknown}}}" tabindex="0"><!-- Wrap Name in a span with the id in a title. tabindex allows mobile clients to see id by tapping -->{{{Name}}}</span>
|{{{Condition|''Please add the condition of this badge!''}}}
|{{{BP|class="empty"{{!}}}}}
{{#if:{{{Notes|}}}|{{!}}{{{Notes}}}|{{!}} style="background:#CDCDCD" ; {{!}}}}
|class="{{#if:{{{Traits|}}}|center-text|empty}}"|<!-- If no traits, dark cell
|{{#arraymap:{{{Author|''Please add author credits!''}}}|,|item|item|,\s|and}}
-->{{#if:{{#pos:{{{Traits}}}|s hidden}}<!--
|{{{Date|{{{Batch|''TBA''}}}}}}
-->|<span tabindex="0" title="Hidden">🏆</span><br><!--
{{#if:{{{type|}}}|{{#ifeq:{{{type}}}|YNOproject||
  -->{{#subobject:{{{id|}}}<!--
{{#subobject:{{{id}}}
  -->|Badge/Is hidden=true<!--
|Badge/Icon = {{#arraymap:{{{Icon|unknown}}}|,|item|File:item|,}}|+sep=,
  -->}}<!--
|Badge/Name = {{{Name|unknown}}}
-->|<!--
|Badge/Location = {{#arraymap:{{{Location|unknown}}}|,|item|{{{type}}}:item|,}}|+sep=,
  -->{{#subobject:{{{id|}}}<!--
|Badge/Author = {{#arraymap:{{{Author|unknown}}}|,|item|item|,}}|+sep=,
  -->|Badge/Is hidden=false<!--
}}
  -->}}<!--
{{#if:{{{Date|}}}|{{#subobject:{{{id}}}|Badge/Date = {{{Date}}}}}|{{#if:{{{Batch|}}}|{{#subobject:{{{id}}}|Badge/Date = {{{Batch}}}}}|}}}}
-->}}<!--
}}}}</includeonly>
-->{{#if:{{#pos:{{lc:{{{Traits}}}}}|is secret}}<!--
<noinclude>{{documentation}}</noinclude>
-->|<span tabindex="0" title="Secret">🔒</span><br><!--
  -->{{#subobject:{{{id|}}}<!--
  -->|Badge/Is secret=true<!--
  -->}}<!--
-->|<!--
  -->{{#subobject:{{{id|}}}<!--
  -->|Badge/Is secret=false<!--
  -->}}<!--
-->}}<!--
-->{{#if:{{#pos:{{{Traits}}}|as secret condition}}<!--
-->|<span tabindex="0" title="Secret condition">🤐</span><br><!--
  -->{{#subobject:{{{id|}}}<!--
  -->|Badge/Has secret condition=true<!--
  -->}}<!--
-->|<!--
  -->{{#subobject:{{{id|}}}<!--
  -->|Badge/Has secret condition=false<!--
  -->}}<!--
-->}}<!--
-->{{#if:{{#pos:{{{Traits}}}|as secret map}}<!--
-->|<span tabindex="0" title="Secret map">🗺</span><br><!--
  -->{{#subobject:{{{id|}}}<!--
  -->|Badge/Has secret map=true<!--
  -->}}<!--
-->|<!--
  -->{{#subobject:{{{id|}}}<!--
  -->|Badge/Has secret map=false<!--
  -->}}<!--
-->}}<!--
-->{{#if:{{{Parent|}}}<!--
-->|<span tabindex="0" title="Secret revealed by unlocking {{#show:YNOproject:Badges/{{{type|{{SUBPAGENAME}}}}}#{{{Parent}}}|?Badge/Name|default=a previous badge}}">🔐</span><br><!--
  -->{{#subobject:{{{id|}}}<!--
  -->|Badge/Has parent=true<!--
  -->|Badge/Parent={{{Parent|}}}<!--
  -->}}<!--
-->|<!--
  -->{{#subobject:{{{id|}}}<!--
  -->|Badge/Has parent=false<!--
  -->}}<!--
-->}}
|<!--
-->{{#if:{{{Location|}}}<!--
-->|<!--
  -->{{#arraymap:{{{Location}}}<!-- Format and list locations as links using type
  -->|,<!--
  -->|@<!--
  -->|[[{{{type|{{SUBPAGENAME}}}}}:@{{!}}{{#replace:@|#|:&#32;}}]]<!-- Replace hashes with colon and space
  -->|,\s<!--
  -->|and<!--
  -->}}<!--
-->|class="empty"{{!}}<!--
-->}}
|{{{Description|class="empty"{{!}}}}}
|{{{Condition}}}
|{{{Notes|class="empty"{{!}}}}}
|{{{Author}}}<!-- Authors should be separated by the usual & symbol -->
|{{{Date|{{badge/Batch2Date|{{{Batch|Unknown}}}}}}}}<br>Batch&nbsp;{{{Batch|}}}<!--
-->{{#subobject:{{{id|}}}
|Badge/ID = {{{id|}}}
|Is part of game = {{{type|{{SUBPAGENAME}}}}}
|Badge/Icon = {{#arraymap:{{{Icon|}}}|,|@|File:@|,}}|+sep=,
|Badge/Name = {{{Name|}}}
|Badge/BP = {{{BP|}}}
|Badge/Location = {{#arraymap:{{{Location|}}}|,|@|{{{type|{{SUBPAGENAME}}}}}:{{#explode:@|#|0}}|,}}|+sep=,
|Badge/Description = {{{Description|}}}
|Badge/Condition = {{{Condition|}}}
|Badge/Notes = {{{Notes|}}}
|Badge/Author = {{{Author|}}}|+sep=&
|Badge/Date = {{{Date|{{badge/Batch2Date|{{{Batch|}}}}}}}}
|Badge/Batch = {{{Batch|}}}
}}<!--
-->
<!-- Above is just a newline
--></includeonly><noinclude>
{{documentation}}
</noinclude>

Latest revision as of 23:00, 19 September 2024

Documentation (for the above template, sometimes hidden or invisible)

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.



Visit Template:Badge/doc to edit this text! (How does this work?)