Template:Ooucat: Difference between revisions
From Tardis Wiki, the free Doctor Who reference
No edit summary |
No edit summary Tags: Mobile edit Mobile web edit |
||
(39 intermediate revisions by 4 users not shown) | |||
Line 1: | Line 1: | ||
<div id=" | <div id="tech">'''''{{PAGENAME}}''' is an <u>out-of-universe</u> category.'' Don't put it in an '''[[Doctor Who universe|in-universe]]''' category <!-- | ||
<noinclude> | |||
[[ | Here the template takes a turn for the complicated by having two switching elements, one nested within the other. The overarching, or umbrella, switch determines the two letters that are at positions 8 and 9 in the page name | ||
-->{{#switch:{{#sub:{{PAGENAME}}|8|2}}<!-- | |||
Depending on what it finds, immediately after the word "stories"/"sources", it will change the message. If it finds the word "by", as in [[category:Stories by decade]], it doesn't try to offer a category in the text. | |||
-->|by=or any category that doesn't have the word '''''stories''''' or '''''sources''''' in it. Categories about sources should only be in ''other'' categories about sources.<!-- | |||
If it finds the letters "re", which only happens in the case of one of the "stories released in" categories, then it offers a solution based on the case | |||
-->|re=like '''{{#ifeq:{{#sub:{{#replace:{{#replace:{{#sub:{{PAGENAME}}|20|}}|the|}}||}}|-1}}|s|{{#replace:{{#replace:{{#sub:{{PAGENAME}}|20|}}|the|}}||}}|{{#replace:{{#replace:{{#replace:{{#sub:{{PAGENAME}}|20|}}|the|}}||}}|{{#sub:{{#replace:{{#replace:{{#sub:{{PAGENAME}}|20|}}|the|}}||}}|-1}}|0s}}}}''', or any category that doesn't have the word '''''stories''''' or '''''sources''''' in it. Categories about sources should only be in ''other'' categories about sources.<!-- | |||
If it finds NOTHING at the 8th position, then that, too, indicates a unique case. This time, either [[category:stories]] or [[category:sources]]. Another check is performed to see if this is [[category:sources]]. If so, a unique message is offered. | |||
-->| ={{#ifeq:{{#sub:{{PAGENAME}}|2|1}}|o|nor any other category but '''[[:category:real world]]'''.}}<!-- | |||
If it finds that the letters are "se", then that indicates the most common syntax for a "stories set in" category. However, there are two main constructions, and so a second switch has to go in here. If it finds that the three letters after the 15th position -- that is, the word after "stories set in" -- is the word "the", then it knows that the construction is like "stories set in THE 1890s", and it offers an inline category that is based only on the expression AFTER the word "the". So, in the case of "stories set in the 1890s", the code returns [[category:1890s]]. Note, too, that it checks to see whether there IS such a category first. If it finds one, it links to it. If it does find it, then it merely bolds the expression, category:1890s. | |||
-->|se={{#switch:{{#sub:{{PAGENAME}}|15|3}} | |||
|the={{#ifexist:category:{{#sub:{{PAGENAME}}|19|}} |like '''category:{{#sub:{{PAGENAME}}|19|}}''' | |||
|like '''category:{{#sub:{{PAGENAME}}|19|}}'''}} or any category that doesn't have the word '''''stories''''' or '''''sources''''' in it. Categories about sources should only be in ''other'' categories about sources.<!-- | |||
the default of this nested switch are categories like those in the form, "stories set in <wherever/whenever>". This works just like the above. All the categories whose first two words are "stories set", but which don't have a fourth word "the", will be handled by this rule. So, things like "stories set in New York City" or "stories set in 2010", or even things like "stories set on Earth" respond to the following code: | |||
-->|#default=like '''category:{{{1|{{#sub:{{PAGENAME}}|15|}}}}}''' | |||
|like '''category:{{{1|{{#sub:{{PAGENAME}}|15|}}}}}''' or any category that doesn't have the word '''''stories''''' or '''''sources''''' in it. Categories about sources should only be in ''other'' categories about sources.}}}}</div> | |||
<noinclude>This template is placed on category pages that have the word "stories" or "sources" in their titles. It reacts very differently depending on the category page on which it's placed. Its various forms can't be shown to you on this page. If you're curious about this code, take a look! It's fully annotated. | |||
[[Category:Category templates]]{{lock}}</noinclude> |
Latest revision as of 10:16, 13 April 2024
Ooucat is an out-of-universe category. Don't put it in an in-universe category
This template is placed on category pages that have the word "stories" or "sources" in their titles. It reacts very differently depending on the category page on which it's placed. Its various forms can't be shown to you on this page. If you're curious about this code, take a look! It's fully annotated.