Difference between revisions of "Template:MWsportnameYYYYOlyCat"
Jump to navigation
Jump to search
imported>BrownHairedGirl m (Protected "Template:MWsportnameYYYYOlyCat": Highly visible template ([Edit=Require template editor access] (indefinite) [Move=Require template editor access] (indefinite))) |
imported>BrownHairedGirl (tweak) |
||
| Line 4: | Line 4: | ||
# First check that the title ends with the phrase "at the YYYY Summer Olympics" or "at the YYYY Winter Olympics". | # First check that the title ends with the phrase "at the YYYY Summer Olympics" or "at the YYYY Winter Olympics". | ||
# which have not been examined or tested | # which have not been examined or tested | ||
| − | -->{{#ifexpr: {{#invoke:String|find|source={{PAGENAME}}|target=at the %d%d%d%d | + | -->{{#ifexpr: ({{#invoke:String|find|source={{PAGENAME}}|target=at the %d%d%d%d Winter Olympics$|start=1|plain=false}} + {{#invoke:String|find|source={{PAGENAME}}|target=at the %d%d%d%d Summer Olympics$|start=1|plain=false}}) = 0 |
|<!-- | |<!-- | ||
# It DOES NOT contain the phrase the phrase "YYYY Summer Olympics category" or "YYYY Winter Olympics category". | # It DOES NOT contain the phrase the phrase "YYYY Summer Olympics category" or "YYYY Winter Olympics category". | ||
Latest revision as of 00:11, 24 February 2020
| This template is used on approximately 140 pages and changes may be widely noticed. Test changes in the template's /sandbox or /testcases subpages, or in your own user subpage. Consider discussing changes on the talk page before implementing them.
Transclusion count updated automatically (see documentation). |
To create a category of the form "[Women's/Men's] sportname at the YYYY [Summer/Winter] Olympics", e.g. Category:Men's alpine skiing at the 2018 Winter Olympics or Category:Women's short track speed skating at the 2002 Winter Olympics.
It produces header text, including navboxes, and parent categories.
Usage
{{MWsportnameYYYYOlyCat}}
The category takes no parameters. Instead it parses the category title to find the sex, sport, year and games.
The logic used to do so may not perfect. If it produces odd results, a diagnostic mode displays how the title was parsed:
{{MWsportnameYYYYOlyCat|diagnostics=yes}}
| The above documentation is transcluded from Template:MWsportnameYYYYOlyCat/doc. (edit | history) Editors can experiment in this template's sandbox (edit | diff) and testcases (create) pages. Please add categories to the /doc subpage. Subpages of this template. |