Difference between revisions of "Template:Season/doc"

From Stardew Valley Wiki
Jump to navigation Jump to search
 
(3 intermediate revisions by the same user not shown)
Line 1: Line 1:
 +
==Description==
 
This template displays the icon for the requested season, plus the season as a link to its associated article.
 
This template displays the icon for the requested season, plus the season as a link to its associated article.
 
The icon and text are enclosed in a nowrap span, so that they are always displayed on the same line.
 
  
 
==Notes==
 
==Notes==
 
The template recognizes two special values of season, <samp>Marriage</samp> and <samp>Deviations</samp>, for the sake of NPC schedule pages (see [[Template:ScheduleHeader]]).
 
The template recognizes two special values of season, <samp>Marriage</samp> and <samp>Deviations</samp>, for the sake of NPC schedule pages (see [[Template:ScheduleHeader]]).
  
==Usage==
+
==Use==
===Syntax===
+
<pre>{{Season|name of season|day (optional)|width (optional)}}</pre>
Basic usage:
 
<nowiki>{{</nowiki>[[Template:Season|Season]] | ''season'' <nowiki>}}</nowiki>
 
 
 
Complete argument list:
 
<nowiki>{{</nowiki>[[Template:Season|Season]] | ''season'' | ''day''
 
          | size=''px'' | width=''widthpluspx'' | all=''text_for_all'' | sortkey=true | space=''value''
 
          | text_only=true | no_translate=true <nowiki>}}</nowiki>
 
 
 
===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: <samp>Spring, Summer, Fall, Winter, All Seasons, Marriage, Deviations</samp>.  <samp>All</samp> and <samp>Any</samp> are recognized as synonyms for <samp>All Seasons</samp>.
 
** 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). If the <samp>''season''</samp> 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.,'' <samp><nowiki>{{Season|Spring}}</nowiki></samp>.
 
 
 
* '''''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.,'' <nowiki>width=24px</nowiki>).
 
** This is redundant with <samp>size</samp> and inconsistent (expects a different format); only one (preferably <samp>size</samp>) should be used.
 
** This parameter is included solely for backwards compatibility and is deprecated
 
 
 
* '''all=''text_for_all'''''
 
** Relevant only if <samp>''season''</samp> is <samp>All Seasons</samp> (or a synonym): when <samp>all</samp> is set, the specified text will be displayed instead of <samp>All</samp>.  Default value is <samp>All</samp>.
 
 
 
* '''sortkey=true'''
 
** If set, a hidden span containing a numeric sortkey will be added to the output, to improve table sorting. The sortkey will causes seasons to be sorted in order Spring, Summer, Fall, Winter, instead of being sorted alphabetically. Plus any provided <samp>day</samp> will be included in the sortkey.
 
  
 
===Examples===
 
===Examples===
Line 49: Line 12:
 
{{Season|Marriage}}
 
{{Season|Marriage}}
 
{{Season|Deviations}}
 
{{Season|Deviations}}
{{Season|All|size=48}}
+
{{Season|All|width=48}}
 
{{Season|Summer|24}}
 
{{Season|Summer|24}}
 
</pre>
 
</pre>
Line 57: Line 20:
 
{{Season|Marriage}}<br />
 
{{Season|Marriage}}<br />
 
{{Season|Deviations}}<br />
 
{{Season|Deviations}}<br />
{{Season|All|size=48}}<br />
+
{{Season|All|width=48}}<br />
 
{{Season|Summer|24}}<br />
 
{{Season|Summer|24}}<br />
  
<includeonly>[[Category:Formatting templates]]{{Addlanglinks}}</includeonly><noinclude>[[Category:Template documentation]]</noinclude>
+
<includeonly>{{Addlanglinks}}[[Category:Templates]]</includeonly><noinclude>[[Category:Template documentation]]</noinclude>

Latest revision as of 21:28, 8 January 2023

Description

This template displays the icon for the requested season, plus the season as a link to its associated article.

Notes

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

Use

{{Season|name of season|day (optional)|width (optional)}}

Examples

{{Season|Spring}}
{{Season|Marriage}}
{{Season|Deviations}}
{{Season|All|width=48}}
{{Season|Summer|24}}

Results:
Spring.png Spring
Mermaid's Pendant.png Marriage
Deviations
48 All
Summer.png 24 Summer