Difference between revisions of "Template:Season/doc"

From Stardew Valley Wiki
Jump to navigation Jump to search
m (remove bullets (realized they could be misinterpreted as part of output))
(Update with new params)
Line 12: Line 12:
  
 
Complete argument list:
 
Complete argument list:
  <nowiki>{{</nowiki>[[Template:Season|Season]] | ''season'' | size=''px'' | width=''widthpluspx'' | do_short=true
+
  <nowiki>{{</nowiki>[[Template:Season|Season]] | ''season'' | ''day''
 +
          | size=''px'' | width=''widthpluspx'' | all=''text_for_all'' | sortkey=true
 
           | text_only=true | no_translate=true <nowiki>}}</nowiki>
 
           | text_only=true | no_translate=true <nowiki>}}</nowiki>
  
 
===Parameters===
 
===Parameters===
There is one unnamed, required parameter, ''season''.  All other parameters are named and optional.  Default value for all arguments is empty, unless specified otherwise.
+
There is one unnamed required parameter, ''season'', and one unnamed optional parameter, ''day''.  All other parameters are named and optional.  Default value for all arguments is empty, unless specified otherwise.
  
 
* '''''season'''''
 
* '''''season'''''
Line 24: Line 25:
 
** If an unrecognized season name is provided, the template will simply print out that name (no link, no icon).
 
** If an unrecognized season name is provided, the template will simply print out that name (no link, no icon).
 
** The seasons should be provided as plain text (unlinked). However, to allow the template to work regardless of user input choices, links such as <tt><nowiki>[[Spring]]</nowiki></tt> will work. Also, if the <tt>''season''</tt> already contains any type of image link, the template will just return the input value unaltered (in case user input already included the season call, e.g., <tt><nowiki>{{Season|Spring}}</nowiki></tt>.
 
** The seasons should be provided as plain text (unlinked). However, to allow the template to work regardless of user input choices, links such as <tt><nowiki>[[Spring]]</nowiki></tt> will work. Also, if the <tt>''season''</tt> already contains any type of image link, the template will just return the input value unaltered (in case user input already included the season call, e.g., <tt><nowiki>{{Season|Spring}}</nowiki></tt>.
 +
 +
* '''''day'''''
 +
** Second unnamed parameter, optional
 +
** The day of the season, for example to generate formatted villager birthdays.
 +
** Any provided value is displayed in front of the season name (but after the icon), to match the format used in-game for birthdays.
  
 
* '''size=''px'''''
 
* '''size=''px'''''
Line 34: Line 40:
 
** This parameter is included solely for backwards compatibility and is deprecated
 
** This parameter is included solely for backwards compatibility and is deprecated
  
* '''do_short=true'''
+
* '''all=''text_for_all'''''
** Relevant only if <tt>''season''</tt> is <tt>All Seasons</tt> (or a synonym): when <tt>do_short</tt> is set, <tt>All</tt> will be displayed instead of <tt>All Seasons</tt>
+
** Relevant only if <tt>''season''</tt> is <tt>All Seasons</tt> (or a synonym): when <tt>all</tt> is set, the specified text will be displayed instead of <tt>All</tt>.  Default value is <tt>All</tt>.
 +
 
 +
* '''sortkey=true'''
 +
** If set, a hidden span containing a numeric sortkey will be added to the output, to improve table sorting. (Seasons will be sorted in order Spring, Summer, Fall, Winter, instead of being sorted alphabetically).
  
 
* '''text_only=true'''
 
* '''text_only=true'''
Line 51: Line 60:
 
{{Season|Deviations}}
 
{{Season|Deviations}}
 
{{Season|All|do_short=true}}
 
{{Season|All|do_short=true}}
{{Season|All|size=48}}</pre>
+
{{Season|All|size=48}}
 +
{{Season|Summer|24}}</pre>
  
 
Results:<br/>
 
Results:<br/>
Line 59: Line 69:
 
{{Season|Deviations}}<br/>
 
{{Season|Deviations}}<br/>
 
{{Season|All|do_short=true}}<br/>
 
{{Season|All|do_short=true}}<br/>
{{Season|All|size=48}}
+
{{Season|All|size=48}}<br/>
 +
{{Season|Summer|24}}
  
 
<includeonly>[[Category:Formatting templates]]</includeonly><noinclude>[[Category:Template documentation]]</noinclude>
 
<includeonly>[[Category:Formatting templates]]</includeonly><noinclude>[[Category:Template documentation]]</noinclude>

Revision as of 04:13, 22 September 2020

This template displays the icon for the requested season, plus the season as a link to its associated article. One or more seasons may be specified, separated by commas.

The icon and text are enclosed in a nowrap span, so that they are always displayed on the same line.

Notes

The template recognizes two special values of season, Marriage and Deviations, for the sake of NPC schedule pages (see Template:ScheduleHeader).

Usage

Syntax

Basic usage:

{{Season | season }}

Complete argument list:

{{Season | season | day
         | size=px | width=widthpluspx | all=text_for_all | sortkey=true
         | text_only=true | no_translate=true }}

Parameters

There is one unnamed required parameter, season, and one unnamed optional parameter, day. All other parameters are named and optional. Default value for all arguments is empty, unless specified otherwise.

  • season
    • First unnamed parameter, required
    • The name of the season to be displayed, recognized values: Spring, Summer, Fall, Winter, All Seasons, Marriage, Deviations. All and Any are recognized as synonyms for All Seasons.
    • Multiple seasons can be specified, separated by commas
    • If an unrecognized season name is provided, the template will simply print out that name (no link, no icon).
    • The seasons should be provided as plain text (unlinked). However, to allow the template to work regardless of user input choices, links such as [[Spring]] will work. Also, if the season already contains any type of image link, the template will just return the input value unaltered (in case user input already included the season call, e.g., {{Season|Spring}}.
  • day
    • Second unnamed parameter, optional
    • The day of the season, for example to generate formatted villager birthdays.
    • Any provided value is displayed in front of the season name (but after the icon), to match the format used in-game for birthdays.
  • size=px
    • Size of icon in pixels. Default value is 24
    • Only the number should be provided (do not append "px").
  • width=widthpluspx
    • Size of icons in pixels with px (e.g., width=24px).
    • This is redundant with size and inconsistent (expects a different format); only one (preferably size) should be used.
    • This parameter is included solely for backwards compatibility and is deprecated
  • all=text_for_all
    • Relevant only if season is All Seasons (or a synonym): when all is set, the specified text will be displayed instead of All. Default value is All.
  • sortkey=true
    • If set, a hidden span containing a numeric sortkey will be added to the output, to improve table sorting. (Seasons will be sorted in order Spring, Summer, Fall, Winter, instead of being sorted alphabetically).
  • text_only=true
    • When set, return value is just the name of the season (no icon, no link), in wiki-specific language
    • Allows other templates to use Template:Season for processing of generic season input data (especially on non-english wikis where translation capabilities may be wanted).
  • no_translate=true
    • When set, any text_only return value is provided in English, instead of the wiki-specific language
    • Only relevant if text_only is set.

Examples

{{Season|Spring}}
{{Season|Summer, Fall, Winter}}
{{Season|Marriage}}
{{Season|Deviations}}
{{Season|All|do_short=true}}
{{Season|All|size=48}}
{{Season|Summer|24}}

Results:
Spring.png Spring
Summer, Fall, Winter
Mermaid's Pendant.png Marriage
Deviations
All Seasons Icon.png All
All Seasons Icon.png All
Summer.png 24 Summer