Help:Variables

From PostgreSQL wiki

Variables or Magic words are strings of text that MediaWiki associates with a return value or function, such as time, site details, or page names. This page is about usage of standard magic words; for a technical reference, see Magic words.

Contents

General notes

Inheritance

Page-dependent magic words will affect or return data about the current page, regardless of whether it is in the page code or a transcluded template.

Behaviour switches

A behaviour switch controls the layout of the page. They are written as a magic word wrapped with double underscores.

Word

Description

Versions

Table of contents

__NOTOC__

Hides the table of contents (TOC).

__FORCETOC__

Forces the table of content to appear at its normal position (above the first header).

__TOC__

Places a table of contents at the word's current position (overriding __NOTOC__). If this is used multiple times, the table of contents will appear at the first word's position.

Editing

__NOEDITSECTION__

Hides the section edit links beside headings.

__NEWSECTIONLINK__

Adds a link (("+" by default) beside the "edit" tab for adding a new section on a non-talk page (see [1]).

1.7+

Categories

__NOGALLERY__

Used on a category page, replaces thumbnails in the category view with normal links.

1.7+

__HIDDENCAT__

Used on a category page, hides the category from the lists of categories in its members and parent categories (hidden categories can be made visible using CSS).

1.13+

Language conversion

__NOCONTENTCONVERT____NOCC__

On wikis with language variants, don't perform any content language conversion (character and phase) in article display; for example, only show Chinese (zh) instead of variants like zh_cn, zh_tw, zh_sg, or zh_hk.

__NOTITLECONVERT____NOTC__

On wikis with language variants, don't perform language conversion on the title (all other content is converted).

Other

__END__

Explicitly marks the end of the article, to prevent MediaWiki from removing trailing whitespace (does not seem to work anymore).

__START__

No effect.

Variables

The syntax of variables is similar to templates, but capitalized to help avoid conflicts. If a template has the same name and case as a variable, the variable will be used. Usage of the template can be forced by adding the "msg:" modifier (for example, "{{msg:CURRENTYEAR}}"). In some cases, adding parameters will force the parser to treat a variable as a template; for example, {{CURRENTDAYNAME|x}} tries to transclude "Template:CURRENTDAYNAME".

Date & time

The following variables return the current date and time according to the user's timezone preferences, defaulting to the UTC timezone.

Due to MediaWiki and browser caching, these variables frequently show when the page was cached rather than the current time.