Help:Magic words: Difference between revisions

Content deleted Content added
No edit summary
m Text replacement - "[[WP:" to "[[Wikipedia:WP:"
Line 5:
{{Wikipedia how-to}}
 
'''Magic words''' (including '''parser functions''', '''variables''' and '''behavior switches''') are features of [[Help:Wiki markup|wiki markup]] that give instructions to Wikipedia's underlying [[MediaWiki]] software. For example, magic words can suppress or position the table of contents, disable indexing by external search engines, and produce output dynamically based on the current page or on user-defined conditional logic. Some of these features are especially useful for [[Wikipedia:WP:Templates|templates]].
 
This page is a quick reference for magic words. For more information, refer to the main MediaWiki documentation:
Line 21:
* Magic words are [[case sensitive]].
* [[Whitespace character|White space]] is generously allowed for readability. It will be stripped from the start and end of their keywords and parameters (as is also done inside templates).
* They can be [[Wikipedia:WP:Transclusion|transcluded]], even variables "about the current page". This is ensured by the parsing order.
* Instead of magically transforming into HTML instructions, {{tag|[[help:wikitext#Nowiki|nowiki]]|o}} tags remove this magic so a magic word can itself be displayed (documented), e.g. <code><nowiki><nowiki>{{#magic:}}</nowiki></nowiki></code> or <code><nowiki>{{#magic:<nowiki />}}</nowiki></code>.
 
Line 59:
|-
! scope="row" | <kbd><nowiki>__HIDDENCAT__</nowiki></kbd>
| Makes a category [[Wikipedia:WP:HIDDENCAT|hidden]] when included on that category's page.
|-
! scope="row" | <kbd><nowiki>__INDEX__</nowiki></kbd>
Line 71:
|-
! scope="row" | <kbd><nowiki>__DISAMBIG__</nowiki></kbd>
| Marks a page as a [[Wikipedia:WP:DAB|disambiguation page]], adds it to [[Special:DisambiguationPages]] and places inward links in [[Special:DisambiguationPageLinks]]. (See [[mw:Extension:Disambiguator]].)
|-
! scope="row" | <kbd>{<nowiki/>{DISPLAYTITLE:''title''}}</kbd>
| Used to amend the [[Wikipedia:WP:DISPLAYTITLE|displayed form]] of the page's title.
|-
! scope="row" | <kbd>{<nowiki/>{DEFAULTSORT:''sortkey''}}</kbd>
| Sets the default [[Wikipedia:WP:SORTKEY|key]] (the index) under which the page is categorised.
|-
! scope="row" | <kbd>[[mw:Extension:Wikibase Client#noexternallanglinks|{<nowiki/>{NOEXTERNALLANGLINKS}}]]</kbd>
Line 265:
|-
! scope="row" | <kbd>{<nowiki/>{PENDINGCHANGELEVEL}}</kbd>
| Protection level for [[Wikipedia:WP:PC|pending changes]] on the current page.
|-
! scope="row" | <kbd>{<nowiki/>{PAGESINCATEGORY:''categoryname''}}</kbd>
Line 333:
|-
! scope="row" | <kbd> {{((}}urlencode:''string''{{))}} </kbd>
| [[Wikipedia:WP:ENCODE|Encodes]] ''string'' for use in URL query strings; <kbd>{{braces|urlencode:test string}}</kbd>, for example, produces: {{urlencode:test string}}. To encode ''string'' for use in URL paths or MediaWiki page names, append, respectively, {{para||PATH}} or {{para||WIKI}} (to produce "{{urlencode:test string|PATH}}" or "{{urlencode:test string|WIKI}}").
|-
! scope="row" | <kbd> {{((}}anchorencode:''string''{{))}} </kbd>