Help:Magic Words: Difference between revisions

From Iskomunidad
Jmtirao (talk | contribs)
 
Jmtirao (talk | contribs)
No edit summary
Line 1: Line 1:
[[Category:Help Pages]]
'''Magic words''' are strings of codes which associates with a return value or function, such as time, site details, or page names. This page is about usage of standard magic words.
 
Basically there are three types of magic words:
*'''[[Help:Magic Words#Behaviour_switches|Behavior Switches]]'''. These are uppercase words surrounded by double underscores (eg __FOO__)
*'''[[Help:Magic Words#Variables|Variables]]'''. These are uppercase words surrounded by double braces (eg <nowiki>{{FOO}}</nowiki>).
*'''[[Help:Magic Words#Parser_functions|Parametric or Parser Functions]]'''. These take parameters and are either of the form <nowiki>{{foo:...}}</nowiki> or <nowiki>{{#foo:...}}</nowiki>.
 
__TOC__
 
==Behaviour Switches==
A behaviour switch controls the layout or behaviour of the page and can often be used to specify desired omissions and inclusions in the content.
 
{|class="wikitable" border="1"
 
|-
! Word
!Description
 
|-
|colspan="3"| '''Table of contents'''
|-
| <nowiki>__NOTOC__</nowiki>
| Hides the table of contents (TOC).
 
|-
|<nowiki>__FORCETOC__</nowiki>
| Forces the table of content to appear at its normal position (above the first header).
 
|-
| <nowiki>__TOC__</nowiki>
| Places a table of contents at the word's current position (overriding <nowiki>__NOTOC__</nowiki>). If this is used multiple times, the table of contents will appear at the first word's position.
 
|-
|colspan="3"| '''Editing'''
|-
| <nowiki>__NOEDITSECTION__</nowiki>
| Hides the section edit links beside headings.
 
|-
| <nowiki>__NEWSECTIONLINK__</nowiki>
| Adds a link beside the "edit" tab for adding a new section on a non-talk page.
 
|-
| <nowiki>__NONEWSECTIONLINK__</nowiki>
| Removes the link beside the "edit" tab on pages in talk namespaces.
 
|-
|colspan="3"| '''Categories'''
|-
| <nowiki>__NOGALLERY__</nowiki>
| Used on a category page, replaces thumbnails in the category view with normal links.
 
|-
| <nowiki>__HIDDENCAT__</nowiki>
| Used on a category page, hides the category from the lists of categories in its members and parent categories (there is an option in the [[Help:Preferences|user preferences]] to show them).
 
|-
| colspan="3"| '''Language conversion'''
|-
| <nowiki>__NOCONTENTCONVERT__</nowiki><br /><nowiki>__NOCC__</nowiki>
| 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.
 
|-
| <nowiki>__NOTITLECONVERT__</nowiki><br /><nowiki>__NOTC__</nowiki>
| On wikis with language variants, don't perform language conversion on the title (all other content is converted).
 
|-
|colspan="3"| '''Other'''
|-
| <nowiki>__START__</nowiki>
| No effect.
 
|-
| <nowiki>__END__</nowiki>
| Explicitly marks the end of the article, to prevent MediaWiki from removing trailing whitespace.
 
|-
|  <nowiki>__INDEX__</nowiki>
| Tell search engines to index the page.
 
|-
|  <nowiki>__NOINDEX__</nowiki>
| Tell search engines not to index the page (ie, do not list in search engines' results).
 
|-
|  <nowiki>__STATICREDIRECT__</nowiki>
| On redirect pages, don't allow wiki to automatically update the link when someone moves a page and checks "Update any redirects that point to the original title".
 
|}

Revision as of 18:58, 3 March 2009

Magic words are strings of codes which associates with a return value or function, such as time, site details, or page names. This page is about usage of standard magic words.

Basically there are three types of magic words:

Behaviour Switches

A behaviour switch controls the layout or behaviour of the page and can often be used to specify desired omissions and inclusions in the content.

Word Description
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 beside the "edit" tab for adding a new section on a non-talk page.
__NONEWSECTIONLINK__ Removes the link beside the "edit" tab on pages in talk namespaces.
Categories
__NOGALLERY__ Used on a category page, replaces thumbnails in the category view with normal links.
__HIDDENCAT__ Used on a category page, hides the category from the lists of categories in its members and parent categories (there is an option in the user preferences to show them).
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
__START__ No effect.
__END__ Explicitly marks the end of the article, to prevent MediaWiki from removing trailing whitespace.
__INDEX__ Tell search engines to index the page.
__NOINDEX__ Tell search engines not to index the page (ie, do not list in search engines' results).
__STATICREDIRECT__ On redirect pages, don't allow wiki to automatically update the link when someone moves a page and checks "Update any redirects that point to the original title".