FANDOM


(Test fix for episode infobox breaking on mobile.)
Line 1: Line 1:
 
<includeonly>{{{{{|safesubst:}}}#if:{{{gs|}}}
 
<includeonly>{{{{{|safesubst:}}}#if:{{{gs|}}}
|{{{{{|safesubst:}}}#switch:1
+
|{{{{{|safesubst:}}}#ifexpr:0 < {{{gs}}} and {{{gs}}} < 27|{{{{{|safesubst:}}}#if:{{{1|}}}|one|1}}
|{{{{{|safesubst:}}}#ifexpr:00 < {{{gs}}} and {{{gs}}} < 27|1|0}}={{{{{|safesubst:}}}#if:{{{1|}}}|one|1}}
+
|{{{{{|safesubst:}}}#ifexpr:26 < {{{gs}}} and {{{gs}}} < 53|{{{{{|safesubst:}}}#if:{{{1|}}}|two|2}}
|{{{{{|safesubst:}}}#ifexpr:26 < {{{gs}}} and {{{gs}}} < 53|1|0}}={{{{{|safesubst:}}}#if:{{{1|}}}|two|2}}
+
|{{{{{|safesubst:}}}#ifexpr:52 < {{{gs}}} and {{{gs}}} < 66|{{{{{|safesubst:}}}#if:{{{1|}}}|three|3}}
|{{{{{|safesubst:}}}#ifexpr:52 < {{{gs}}} and {{{gs}}} < 66|1|0}}={{{{{|safesubst:}}}#if:{{{1|}}}|three|3}}
+
|{{{{{|safesubst:}}}#ifexpr:65 < {{{gs}}} and {{{gs}}} < 92|{{{{{|safesubst:}}}#if:{{{1|}}}|four|4}}
|{{{{{|safesubst:}}}#ifexpr:65 < {{{gs}}} and {{{gs}}} < 92|1|0}}={{{{{|safesubst:}}}#if:{{{1|}}}|four|4}}
+
|{{{{{|safesubst:}}}#ifexpr:91 < {{{gs}}} and {{{gs}}} < 118|{{{{{|safesubst:}}}#if:{{{1|}}}|five|5}}
|{{{{{|safesubst:}}}#ifexpr:91 < {{{gs}}} and {{{gs}}} < 118|1|0}}={{{{{|safesubst:}}}#if:{{{1|}}}|five|5}}
+
|{{{{{|safesubst:}}}#ifexpr:117 < {{{gs}}} and {{{gs}}} < 144|{{{{{|safesubst:}}}#if:{{{1|}}}|six|6}}
|{{{{{|safesubst:}}}#ifexpr:117 < {{{gs}}} and {{{gs}}} < 144|1|0}}={{{{{|safesubst:}}}#if:{{{1|}}}|six|6}}
+
|{{{{{|safesubst:}}}#ifexpr:143 < {{{gs}}} and {{{gs}}} < 170|{{{{{|safesubst:}}}#if:{{{1|}}}|seven|7}}
|{{{{{|safesubst:}}}#ifexpr:143 < {{{gs}}} and {{{gs}}} < 170|1|0}}={{{{{|safesubst:}}}#if:{{{1|}}}|seven|7}}
+
|{{{{{|safesubst:}}}#ifexpr:169 < {{{gs}}} and {{{gs}}} < 196|{{{{{|safesubst:}}}#if:{{{1|}}}|eight|8}}
|{{{{{|safesubst:}}}#ifexpr:169 < {{{gs}}} and {{{gs}}} < 196|1|0}}={{{{{|safesubst:}}}#if:{{{1|}}}|eight|8}}
+
|<span class="error">Invalid episode number</span>
|#default=<span class="error">Invalid episode number</span>
+
}}}}}}}}}}}}}}}}
}}
 
 
|{{{{{|safesubst:}}}#if:{{{2|}}}
 
|{{{{{|safesubst:}}}#if:{{{2|}}}
 
|{{{{{|safesubst:}}}#switch:{{{{{|safesubst:}}}#expr:{{{1}}}}}|1=26|2=52|3=65|4=91|5=117|6=143|7=169|8=195|0}}
 
|{{{{{|safesubst:}}}#switch:{{{{{|safesubst:}}}#expr:{{{1}}}}}|1=26|2=52|3=65|4=91|5=117|6=143|7=169|8=195|0}}
Line 15: Line 15:
 
}}
 
}}
 
}}</includeonly><noinclude>
 
}}</includeonly><noinclude>
This is a utility template for '''e'''pisodes '''p'''er '''s'''eason data. The default behavior is to return the number of episodes in the given season. Defining a second parameter makes it return the overall number of episodes through the end of that season. The {{para|gs}} parameter can be used instead: short for "get season", it expects an overall episode number (which can be gotten through {{T|nameconvert}}) and returns the season number of that episode. With the gs parameter, defining an unnamed parameter returns the number spelled out.
+
This is a utility template for '''e'''pisodes '''p'''er '''s'''eason data. The default behavior is to return the number of episodes in the given season. Defining a second parameter makes it return the overall number of episodes through the end of that season. The {{para|gs}} parameter can be used instead: short for "get season", it expects an overall episode number (which can be obtained through {{T|nameconvert}}) and returns the season number of that episode. With the gs parameter, defining an unnamed parameter returns the number spelled out.
   
This template must be updated for new seasons. Follow the existing patterns, and make sure the "|0" remains at the end of each line in the second section.
+
This template must be updated for new seasons. Follow the existing patterns, and make sure the "|0" remains at the end of each line in the second section. If adding a new line to the top section, be sure to add another <code><nowiki>}}</nowiki></code> to the line of those.
 
[[Category:Templates]]</noinclude>
 
[[Category:Templates]]</noinclude>

Revision as of 22:45, October 17, 2018

This is a utility template for episodes per season data. The default behavior is to return the number of episodes in the given season. Defining a second parameter makes it return the overall number of episodes through the end of that season. The |gs= parameter can be used instead: short for "get season", it expects an overall episode number (which can be obtained through {{nameconvert}}) and returns the season number of that episode. With the gs parameter, defining an unnamed parameter returns the number spelled out.

This template must be updated for new seasons. Follow the existing patterns, and make sure the "|0" remains at the end of each line in the second section. If adding a new line to the top section, be sure to add another }} to the line of those.

Community content is available under CC-BY-SA unless otherwise noted.