Difference between revisions of "Template:Season"
Jump to navigation
Jump to search
m (Add date into sort key) |
m (switch to new way of handling sortkey) |
||
Line 29: | Line 29: | ||
-->{{#arraydefine:$slink_text|{{ParseInputValues|code=season|@season@|translate=true}}}}<!-- | -->{{#arraydefine:$slink_text|{{ParseInputValues|code=season|@season@|translate=true}}}}<!-- | ||
− | // | + | // Wrap a sort-key span around all items if requested. On other entries, add space and bullet. |
-->{{#ifexpr:{{#arraysearch:$sseason|@season@}}>0 | -->{{#ifexpr:{{#arraysearch:$sseason|@season@}}>0 | ||
| •  | | •  | ||
− | |{{#if:{{{sortkey|}}}| | + | |{{#ifexpr:{{#if:{{{sortkey|}}}|1|0}} or {{#ifeq:{{{sortkey}}}||1|0}} |
− | <span | + | |<span data-sort-value="{{#ifeq:{{{sortkey}}}|||{{#ifeq:{{{sortkey|true}}}|true |
− | + | |{{#expr:{{#if:{{#arrayprint:$slink_text}} | |
|({{ParseInputValues|code=season|@season@|translate=index}}+1)*100 | |({{ParseInputValues|code=season|@season@|translate=index}}+1)*100 | ||
− | |0}} | + | |0}}{{#iferror:{{#expr:{{{2|0}}}>0}}|| + {{{2|0}}}}}}} |
− | + | |{{{sortkey|}}}}}}}"> | |
}}}}<span style="display:inline; margin-right:0; white-space: nowrap"><!-- | }}}}<span style="display:inline; margin-right:0; white-space: nowrap"><!-- | ||
Line 61: | Line 61: | ||
|{{#if:{{{all|}}}|{{{all|}}}|{{#arrayprint:$lang_allseasons}}}} | |{{#if:{{{all|}}}|{{{all|}}}|{{#arrayprint:$lang_allseasons}}}} | ||
|{{#arrayprint:$slink_text}}}}]]<!-- | |{{#arrayprint:$slink_text}}}}]]<!-- | ||
− | -->}}}}</span>}}}}</includeonly><noinclude>{{Englishdoc}}{{#ifexist:{{FULLPAGENAME}}/doc |<nowiki/> | + | -->}}}}</span>}}<!-- |
+ | -->{{#ifexpr:{{#if:{{{sortkey|}}}|1|0}} or {{#ifeq:{{{sortkey}}}||1|0}}|</span>}} | ||
+ | }}</includeonly><noinclude>{{Englishdoc}}{{#ifexist:{{FULLPAGENAME}}/doc |<nowiki/> | ||
{{{{FULLPAGENAME}}/doc}} }}</noinclude> | {{{{FULLPAGENAME}}/doc}} }}</noinclude> |
Revision as of 20:29, 27 October 2020
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:
Template:ParseInputValues[[File:Template:ParseInputValues.png|
24px | link=Template:ParseInputValues | alt=]] [[Template:ParseInputValues|Template:ParseInputValues]]
Template:ParseInputValues[[File:Template:ParseInputValues.png|
24px | link=Template:ParseInputValues | alt=]] [[Template:ParseInputValues|Template:ParseInputValues]]
Template:ParseInputValues[[File:Template:ParseInputValues.png|
24px | link=Template:ParseInputValues | alt=]] [[Template:ParseInputValues|Template:ParseInputValues]]
Template:ParseInputValues[[File:Template:ParseInputValues.png|
48 | link=Template:ParseInputValues | alt=]] [[Template:ParseInputValues|Template:ParseInputValues]]
Template:ParseInputValues[[File:Template:ParseInputValues.png|
24px | link=Template:ParseInputValues | alt=]] 24 [[Template:ParseInputValues|Template:ParseInputValues]]