Help:Magic Words

A "magic word" is a special function inserted into a page. There are typically four types of magic words: page functions, formatting, variables, and constants. Page functions are input into the page and change how the page handles specific things. Formatting magic words change how strings display. Variables change their value depending on specific scenarios. Constants are less used values that remain the same throughout the site and are only changed manually.

Magic words differ from a classic template as they often do not use parameters. Functions occasionally have a modifier parameter, and formatting usually requires an input string and potentially some modifier parameters.

Text
All of the below can be substituted with  to print the outcome onto the page.

Style
All of the below should not be substituted.

Page
These variables depend on the page they are used on. All can be substituted with  to print the outcome onto the page.

DateTime
These variables use the current time. All can be substituted with  to print the outcome onto the page.

Statistics
These are automated counters. All can be substituted with  to print the outcome onto the page.

Expensive
"Expensive" functions should not be used in templates and used only sparingly in content. The number used are tracked and too many uses on a page will break their functionality.

Constants
Constants are still technically variables, however unlike the aforementioned variables which are designed to vary under different circumstances, the constants are global and are designed to remain the same across the whole site and at all times. Most constants can be changed, however this is only likely to occur under rare conditions.

Despite their rarity, they are encouraged to be used instead of referring to the same thing in words in the unlikelihood that the constants are changed.