Template:User quote

Template page
Revision as of 18:28, 28 October 2023 by Gelthor (talk | contribs) (2 revisions imported: Imported from https://strategywiki.org/)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

{{:User:{{{1}}}/Quotes}}

This page has been transcluded from Template:User quote/Documentation.


This template returns the contents of a user's "Quotes" page. To be most effective, the quotes page should be set up with multiple quotes as outlined below.

Usage[edit source]

{{user quote|User name}}
{{user quote|User name|Pagename}}

The template accepts two parameters, a user name and an optional page name if other than "Quotes".

User quotes page[edit source]

To initialize the quotes for a user, set up a quotes page at "User:User name/PAGENAME" where PAGENAME is the name of the page. The template expects the page name to be "Quotes" by default, so make sure you add the second parameter when using the template if you put the content somewhere else. Copy and paste the following setup into the page.

{{#switch:{{#expr:{{CURRENTTIMESTAMP}} mod 6}}<!-- INSERT NUMBER OF QUOTES PLUS ONE HERE ("mod n+1") -->
|0=
|1=
|2=
|3=
|4=
}}

Quotes go in each parameter, after the number and equals sign (e.g. 0= or 1=). The number of quotes listed plus one goes at the end of the first line, just before the two braces at the end. In the template above, the number is "6". Note that this number is two more than the highest parameter number, because they start at zero.

To add a quote, start another line at the bottom of the template with the next number as the parameter name. In the example above, on the next line after the quote in 4=, you would put |5=quote. Then update the number in the first line (e.g. change it from "6" to "7").

To remove a quote, delete the whole line, including the pipe and parameter at the beginning. If you removed a quote in the middle of the template, meaning it wasn't the last quote in the list, renumber the parameters from zero to the last one so they go in order again. (You can just replace the last parameter with the parameter of the line you erased, but eventually this could get messy.) Finally, update the number in the first line (e.g. change it from "6" to "5").

Example[edit source]

The following example is based on the user John Doe.

In the page "User:John Doe/Quotes":

{{#switch:{{#expr:{{CURRENTTIMESTAMP}} mod 4}}<!-- INSERT NUMBER OF QUOTES PLUS ONE HERE ("mod n+1") -->
|0=Hi! I'm John Doe.
|1=I love lamp.
|2=Let the editing begin!
}}

To get a random quote:

{{user quote|John Doe}}