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



    YumeWiki
    2,829Articles

    Template:Badge/doc: Difference between revisions

    (switch to lowercase)
     
    (9 intermediate revisions by the same user not shown)
    Line 1: Line 1:
    ==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.
    Formats the table entries in subpages of [[YNOproject:Badges]]. It may be useful as it creates badge subobjects that point a [[Property:Badge/Location|"Badge/Location"]] property to any locations the badge appears in.
     
    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 add normal table entries instead, to avoid lag.
     
    ==Syntax==
    ==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}}.
    <pre><nowiki>{| style="width: 100%;" cellspacing="0" cellpadding="4" border="1"
     
    |-
    The template is used after the table beginning. Here is an example input for a table with 1 entry:
    | style="text-align: center;" |<u>'''Icon(s)'''</u>
    <pre><nowiki>{{badge/Start}}
    | style="text-align: center;" |<u>'''Name'''</u>
    {{badge|type=Yume Nikki|
    | 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></nowiki></pre>
    The template is used after the table beginning. Here is an example input:
    <pre><nowiki>{{badge|type=Yume Nikki|
    |id = fc_moai
    |id = fc_moai
    |Icon = Nasu gold(badgeyn).gif, Nasu gold(badgeyn).png
    |Icon = MoaiStatue(badgeYN).png
    |Name = Tomb of the Moai
    |Name = Tomb of the Moai
    |Location = FC Dungeon
    |Location = FC Dungeon
    Line 23: Line 18:
    |Condition = Enter the moai head room in the FC Dungeon
    |Condition = Enter the moai head room in the FC Dungeon
    |Author = WikiOdd
    |Author = WikiOdd
    }}</nowiki></pre>
    |Batch= 56
    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><br>
    }}
    |}</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).
     
    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:
    After adding all badges, make sure to end the table with:
    <pre><nowiki>|}</nowiki></pre>
    <pre><nowiki>|}</nowiki></pre>
    ==Usage==
    ==Usage==
    <!--For this section, explain what subobjects the template creates, and what they tell you-->
    The template creates a subobject with the id as a name. For example, using the template with <code>id=fc_moai</code> 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.
    ''TBA''
    {| class="wikitable"
    |-
    ! style="text-align:center; width:14ch;" |<u>'''Property'''</u>
    ! style="text-align: center;" |<u>'''Function'''</u>
    ! style="text-align: center;" |<u>'''Datatype'''</u>
    |-
    |[[Property:Badge/Author|Badge/Author]]
    |Each author for a badge is listed as a value for this property.
    |Text
    |-
    |[[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]. Badges before 2022-05-06 will not have a batch number and would only have a date.
    |Number
    |-
    |[[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}} if a batch number is provided (recommended), and must be manually provided otherwise.
    |Date
    |-
    |[[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/Game|Badge/Game]]
    |The game the badge is from. Taken from the type/Namespace parameter, or from the subpage name by default.
    |''TBA''
    |-
    |[[Property:Badge/ID|Badge/ID]]
    |The ID of the badge, same as the subobject name.
    |Text
    |-
    |[[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
    |-
    |[[Property:Badge/Name|Badge/Name]]
    |The name of the badge as presented in YNOproject.
    |Text
    |-
    |''[[Property:Badge/Is hidden|Badge/Is hidden]]''
    |Sets to ''true'' for badges with the hidden property in YNOproject.
    |Boolean
    |}
    ==Parameters==
    ==Parameters==
    <templatedata>{ "description": "","params": {
    <templatedata>{ "description": "","params": {
    "type": {
    "label": "Badge Namespace",
    "aliases": ["Namespace"],
    "type": "line",
    "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",
    "required": true
    },
    "id": {
    "id": {
    "label": "Badge ID",
    "label": "Badge ID",
    Line 46: Line 82:
    "required": true,
    "required": true,
    "example": "akako"
    "example": "akako"
    },
    "type": {
    "label": "Badge Namespace",
    "aliases": ["Namespace"],
    "type": "line",
    "description": "The wiki namespace the badge belongs to, which is used to format the wikilinks for the ''Location'' field.",
    "example": "Yume 2kki",
    "autovalue": "{{SUBPAGENAME}}",
    "suggested": true
    },
    },
    "Icon": {
    "Icon": {
    "label": "Badge Icon(s)",
    "label": "Badge 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 files on the wiki likely have different names than the files in 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",
    "example": "Akako Gif Bdg.gif, AkakoStill Bdg.png",
    "suggested": true,
    "suggested": true
    "default": "TBA"
    },
    },
    "Name": {
    "Name": {
    Line 60: Line 104:
    "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",
    "example": "White Scarlet Akako",
    "suggested": true,
    "suggested": true
    "default": "Missing"
    },
    },
    "Location": {
    "Location": {
    Line 79: Line 122:
    "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",
    "example": "Show Akako in the White Scarlet Exhibition all of the effects she likes",
    "suggested": true,
    "suggested": true
    "default": "Please add the condition of this badge!"
    },
    },
    "Notes": {
    "Notes": {
    Line 89: Line 131:
    "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 commas.",
    "example": "Rose",
    "example": "Rose",
    "suggested": true
    },
    "Batch": {
    "label": "Batch Number",
    "type": "number",
    "description": "The batch which contained the badge. Can be found by checking the commit history on github. For badges prior to 2022-05-06, specify 'Date' instead.",
    "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": "If there is no batch number for the badge, provide the date the badge was released.",
    "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"
    },
    },
    "Hidden": {
    "Hidden": {
    Line 121: Line 160:
    "type": "line",
    "type": "line",
    "description": "Set a hex code to use for the background of an ''Icon'' cell, to potentially clear any visibility issues.",
    "description": "Set a hex code to use for the background of an ''Icon'' cell, to potentially clear any visibility issues.",
    "example": "14c932"
    "example": "3498db",
    "suggestedvalues": ["cdcdcd"]
    }}}</templatedata>
    }}}</templatedata>


    ==Sample==
    ==Sample==
    The example given in "Syntax" above would produce the following output:
    The example given in "Syntax" above would produce the following output:
    {| style="width: 100%;" cellspacing="0" cellpadding="4" border="1"
    {{badge/Start}}
    |-
    {{badge|type=Yume Nikki|
    | style="text-align: center;" |<u>'''Icon(s)'''</u>
    |id = fc_moai
    | style="text-align: center;" |<u>'''Name'''</u>
    |Icon = MoaiStatue(badgeYN).png
    | style="text-align: center;" |<u>'''Location'''</u>
    |Name = Tomb of the Moai
    | style="text-align: center;" |<u>'''Description'''</u>
    |Location = FC Dungeon
    | style="text-align: center;" |<u>'''Condition(s)'''</u>
    |Description = What a nice statue!
    | style="text-align: center;" |<u>'''Note(s)'''</u>
    |Condition = Enter the moai head room in the FC Dungeon
    | style="text-align: center;" |<u>'''Author(s)'''</u>
    |Author = WikiOdd
    | style="text-align: center;" |<u>'''Release batch/Date'''</u>
    |Batch = 56
    |-
    }}
    {{#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>__NOTOC__ [[Category:Template documentation]]</noinclude>
    <includeonly>__NOEDITSECTION__</includeonly>
    <includeonly>__NOEDITSECTION__</includeonly>

    Latest revision as of 05:03, 10 May 2024

    Description

    Formats the table entries in subpages of YNOproject:Badges. It may be useful as it creates badge subobjects that point a "Badge/Location" property to any locations the badge appears in.

    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 add normal table entries instead, to avoid lag.

    Syntax

    On the badge page you should already have a table that begins using {{badge/Start}}.

    The template is used after the table beginning. Here is an example input for a table with 1 entry:

    {{badge/Start}}
    {{badge|type=Yume Nikki|
    |id = fc_moai
    |Icon = MoaiStatue(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
    |Batch= 56
    }}
    |}

    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, 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.

    Property Function Datatype
    Badge/Author Each author for a badge is listed as a value for this property. Text
    Badge/Batch The batch the badge was released in, taken from the ynobadges commits page. Badges before 2022-05-06 will not have a batch number and would only have a date. Number
    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}} if a batch number is provided (recommended), and must be manually provided otherwise. Date
    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/Game The game the badge is from. Taken from the type/Namespace parameter, or from the subpage name by default. TBA
    Badge/ID The ID of the badge, same as the subobject name. Text
    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/Is hidden Sets to true for badges with the hidden property in YNOproject. Boolean

    Parameters

    Template parameters

    ParameterDescriptionTypeStatus
    Badge IDid

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

    Example
    akako
    Linerequired
    Badge Namespacetype Namespace

    The wiki namespace the badge belongs to, which is used to format the wikilinks for the ''Location'' field.

    Example
    Yume 2kki
    Auto value
    {{SUBPAGENAME}}
    Linesuggested
    Badge 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.

    Example
    Akako Gif Bdg.gif, AkakoStill Bdg.png
    Filesuggested
    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.

    Example
    White Scarlet Akako
    Linesuggested
    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).

    Example
    White Scarlet Exhibition
    Page nameoptional
    Badge DescriptionDescription

    The description of the badge, if any.

    Contentoptional
    Badge ConditionsCondition

    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
    Contentsuggested
    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 commas.

    Example
    Rose
    Linesuggested
    Batch NumberBatch

    The batch which contained the badge. Can be found by checking the commit history on github. For badges prior to 2022-05-06, specify 'Date' instead.

    Example
    26
    Numbersuggested
    Release DateDate

    If there is no batch number for the badge, provide the date the badge was released.

    Example
    2022-10-05
    Dateoptional
    Hidden Badge PropertyHidden

    Set to ''true'' to signify the badge is hidden. Hidden badges have unique backgrounds, give no BP, and are not counted for certain milestones.

    Default
    false
    Example
    true
    Booleanoptional
    Icon Background OverrideIcon_bg

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

    Suggested values
    cdcdcd
    Example
    3498db
    Lineoptional

    Sample

    The example given in "Syntax" above would produce the following output:

    Icon Name Location Description Condition Notes Author Batch/Date
    MoaiStatue(badgeYN).png
    Tomb of the Moai FC Dungeon What a nice statue! Enter the moai head room in the FC Dungeon WikiOdd Batch 56

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