Difference between revisions of "Template:Heroes or Heroines"
(Last one? I really hope so.) |
m (Add to Category:Formatting templates and Category:Randomized templates) |
||
(7 intermediate revisions by 2 users not shown) | |||
Line 1: | Line 1: | ||
− | {{ | + | {{a or b|a=Heroes|b=Heroines|lcase=1|or={{{or|}}}|daily={{{d|{{{daily|yes}}}}}}|invert={{{i|{{{invert|}}}}}}}}<noinclude> |
+ | {{doc|Template:A or b/Documentation}} | ||
+ | [[Category:Templates|{{PAGENAME}}]] [[Category:Formatting templates|{{PAGENAME}}]] | ||
+ | [[Category:Randomized templates|{{PAGENAME}}]] | ||
+ | </noinclude> |
Latest revision as of 12:00, 20 December 2018
Heroines
The {{a or b}} function implements logic to decide randomly but consistently on a word or phrase to use in text on the GodWiki. It is here for the use of any creator who wishes to allow the Great Random to decide what something in their text should be. The most common use case is to switch an article daily between being about a her or about a him.
It can be called directly, but is most likely to be called by one of the more user-friendly wrapper templates below. You are reading this documentation on {{Heroes or Heroines}}; tables and brief usage notes for the full set of wrapper templates follow. For complete documentation on the master {{a or b}} template, skip to § Complete Parameters.
User-friendly wrappers
These tables show the wrapper functions for various common uses.
Pronoun Case | Uppercase | lowercase |
---|---|---|
Subject | {{He or She}} | {{he or she}} |
Object | {{Him or Her}} | {{him or her}} |
Possessive | {{His or Hers}} | {{his or hers}} |
Adjective | {{His or Her}} | {{his or her}} |
Uppercase | lowercase |
---|---|
{{Hero or Heroine}} | {{hero or heroine}} |
{{Heroes or Heroines}} | {{heroes or heroines}} |
{{God or Goddess}}[T 1] | {{god or goddess}} |
{{Gods or Goddesses}}[T 1] | {{gods or goddesses}} |
Template wikicode | Example result | Note |
---|---|---|
{{heroes and heroines}} | heroines and heroes | Both words lowercase |
{{Heroes and Heroines}} | Heroines and heroes | First word uppercase (for the start of a sentence) |
{{gods and goddesses}} | goddesses and gods | Both words lowercase |
{{Gods and Goddesses}} | Goddesses and gods | First word uppercase (for the start of a sentence) |
{{Gods and Goddesses|uppercase=yes}} | Goddesses and Gods | Both words uppercase |
Wrapper Parameters
All of the wrappers accept these parameters to modify their behavior. None are required for normal use.
|or = anything
- Optional. Set to any value to have the template output both alternates conjoined by or (as in the template name), rather than selecting one or the other. The wikicode "
Maybe {{he or she|or=y}} will get a surprise.
" results in "Maybe she or he will get a surprise." or "Maybe he or she will get a surprise."
|daily = no
or|d = no
- Optional. Set to disable the automatic switching of gender-focus each day (which is enabled by default). The gender of pronouns generated by this template will be fixed for the life of the article (except where
|invert=yes
is used, see next parameter). Accepts any common negative value: "n", "0", "false", etc.
|invert = anything
or|i = anything
- Optional. If set to any value, reverses the usual order of the result. If the male-focussed language is being selected for the page, you will get the female-focussed language with this option, and vice versa.
- Use this to build sensible sentences. For example:
{{He or She}} held {{his or her|invert=yes}} hand in the moonlight.
- will always result in one of:
- "She held his hand in the moonlight."
- "He held her hand in the moonlight."
|uppercase=yes
or|uc=yes
or|u=yes
- Only in
{{Gods and Goddesses}}
, this will make the second word in the phrase (after "and") uppercase.
Complete Parameters
These parameters are accepted by {{a or b}}. The wrapper templates pre-define some of these parameters, and as a result are less flexible (but more convenient).
|a=option a
or|1=option a
- Required. This parameter contains the text to return if the template decides to choose option a. E.g.
|a=him
|b=option b
or|2=option b
- Required. This parameter contains the text to return if the template decides to choose option b. E.g.
|b=her
|or=anything
- Optional. This parameter instructs the template to return both parts conjoined by or. As in, "she or he will get a surprise".
|lcase=anything
- Optional. This parameter instructs the template to lowercase the first letter of the second term in an or conjunction. Use it only if giving the template uppercase Option A and Option B text, with
|or=yes
. As in, "She or he will get a surprise". Omit this if you explicitly want a capital letter in your second term, as in, "Goddesses or Gods are welcome in this guild!"
|daily=yes or no
or|d=yes or no
- Optional, defaults to
yes
. This parameter instructs the template to switch the options in the text each day. Note that, depending on when the page was last cached, you may not always see the change immediately (without purging or editing the page).
|invert=anything
or|i=anything
- Optional. This parameter reverses the usual order of the result. If option a is usually being selected for the page, you will get option b, and vice versa. Allows sensible construction of sentences like:
{{He or She}} kissed {{him or her|i=1}}.
("She kissed him.")
Note that the text given to {{a or b}}
doesn't have to be male or female gendered text. For example:
{{a or b|a=He|b=She}} passed {{a or b|a=her|b=him}} the {{a or b|a=salt|b=pepper}}.
will switch daily between one of these two sentences:
- "She passed him the pepper."
- "He passed her the salt."
Decision Logic
The template uses the page's {{PAGEID}}
property to decide, plus {{CURRENTDAY}}
. If the sum is odd, the option a is chosen; if it's even, option b. (The page you are reading this on has a {{PAGEID}} value of 12343, and the {{CURRENTDAY}} is 16.) If the |daily=
parameter is set to no, the current day of the month (16) is not added before testing if it's odd or even, so the result will remain the same every day.