Help:Random choice

New style (parserfunction)
To choose between one or more options, use the choose parserfunction. The format is similar to using templates:

Note that the first option does not have a | (pipe) character before it, all others do.

If you'd like some options to be shown more often than others, you can add a weight before the option, like so:

Warning: If an option contains an = sign, you can't omit the weight, so for example

is invalid (the weight of option two will be 0); instead just specify the weight explicitly:

Substitution
Like templates, parser functions can also be substituted.  bar  will select one option when you save a page and will replace the choose function with the text of that option. However, substitution is not recursive, so if a template using choose is substituted, the entire choose function with all the options will be copied into the page text, which is probably not what you want.

The simple solution is to use subst:expand: instead of subst:, e.g.:

will take Template:Assquote, recursively substitute every template and parser function in it, and then copy the resulting text into the page when it is saved:

" Anonymous User " (sounds like another self-centered liberal, like Obama), you have free will and can laugh at anything that you can persuade yourself to be funny. I skimmed through your recent edits and there is an anti-Christian tone to your postings, so admit it, you're a supporter of infanticide. Furthermore, you are in denial that preaching about Hell prevents abortion. Got news for you: the Bible is the most logical book ever written. Lots of people are learning that, surprise, surprise, the law applies to vandalism on the internet too. Come back when you can learn out to spell "superior".--Aschlafly 18:26, 15 June 2017 (UTC)

Sometimes you don't want every template substituted. In this case, instead of using subst:expand:, you should change subst: to safesubst: and add includeonly around the safesubst: in the template's choose function, and then use normal substitution:

Unlike transcluded random templates, which change with every reload of the page, substituted templates will remain the same. Transcluded templates increase page loading times, and if they are used on a lot of pages, editing them will slow down the entire site for a long time.

Old style (tag)
Using the parser function is preferable, but you can also use the tag, like so:

This is the first choice. This is the second choice. And so on...

From each set of tags, precisely one tag will be selected at random, and its contents shown.

If you'd like some options to be shown more often than others, you can add weight to the option tags, like so:

This option will be shown twice as often as a normal option. By default, options have a weight of 1. This option also has a weight of 1. Fractional portions are ignored.

Anything can be placed inside of option tags: links, images, even templates. However, template parameters will not be expanded, so they cannot be used in the option text or as a weight. Magic words (such as 27 ) and parser functions (such as ) cannot be used as a weight. The option tag cannot be substituted either. In those cases, you can use the parser function version.