Nameconvert
Talk0
681pages on
this wiki
this wiki
Template page
[edit] []
Template documentation
This template returns the official name of an episode, if given its season and episode numbers or overall number; or the season and episode number ("SXEY"), zero-padded and truncated as specified, if given the official name.
Contents |
Syntax
{{Nameconvert|1|2|pad=|r=}}
If you want to get an episode number:
- There is one unnamed parameter, which is the episode name. Must be exactly the same as listed on episodes.
If you want to get an episode name:
- Use two unnamed parameters: the first is the episode's season number, and the the second is the episode's number in that season. Zero-padding is irelevant.
- Or you can use one unnamed parameter, which is the episode's overall number.
In either case:
- "pad" (optional) is the amount of zero-padding you want.
pad=0will produce no padding,pad=1will pad only the episode number, andpad=2will pad both the season and episode numbers. Won't do anything if you're getting an episode name, obviously. Defaults topad=2. - "r" (short for "return") (optional) is how much you want to be returned (only applies when inputting an episode name). Possible values are
s,sn,e,en— for, respectively, season (S01), season number (01), episode (E01), episode number (01). Default is full return (S01E01). Pad is still applied when using this. Let me know if you need more options.
Examples
{{nameconvert|1|2}}-> Friendship is Magic, part 2{{nameconvert|Baby Cakes}}-> S02E13{{nameconvert|Look Before You Sleep|pad=0}}-> S1E8{{nameconvert|Magic Duel|r=e}}-> E05[[{{nameconvert|2|26}}]]-> A Canterlot Wedding - Part 2[[{{nameconvert|3|1}}|The Crystal Empire]]-> The Crystal Empire[[{{nameconvert|1|1}}/Gallery#Prologue|introduction]]-> introduction{{nameconvert|{{nameconvert|1|25}}}}-> S01E25
Notes
To update this template:
- Add the episode name to the list in the template page's code (or update if just changing the name). If adding a new season, add a section of placeholder values ("Episodes") and a new return value. Follow the existing formatting.
- If adding a new season, a new line in the section below the switch will need to be added, following the same formatting.
- Go to the season subpage (list below) for the episode and add it in the two necessary locations (or update if just changing the name), following the existing formatting.
- Creating a new subpage is relatively simple: copy the entire code from an existing subpage, change the padleft value to the season number, and replace all episode names in the switch lists with "Episodes" (no quotes). Add or remove lines to match the number of episodes in the season.
All values (strings and integers) should follow what is listed on episodes - capitalization, punctuation, and going in airing order rather than production order.
Please contact User:Bobogoobo with any questions or suggestions regarding this template.
Subpages
| Nameconvert/S1 | Nameconvert/S2 | Nameconvert/S3 |
| Nameconvert/doc |
| The above documentation is transcluded from Template:Nameconvert/doc. (edit | history) Editors can experiment in a sandbox. Please add categories and interwikis to the /doc subpage. Subpages of this template. |