Difference between revisions of "Manual:MagicWords"

[unchecked revision][unchecked revision]


What are Magic Words?[edit | edit source]

A "magic word" is a symbol recognized by the MediaWiki software. It triggers the software to do something other than display that symbol, or transclude a page with that name, but instead to use the symbol directly.


How to use Magic Words[edit | edit source]

  1. Klick on edit on designated page
  2. You can insert MagicWords with a special tool named InsertMagic.
    You can choose between WYSIWYG editor InsertMagic.png and wiki code InsertMagic-code.png to insert MagicWords with InsertMagic. But it is also possible to type MagicWords into the wiki code.
  3. Write magic word on designated place

There can be distinguished three major kinds of magic words (behavior switches and variables) which will be defined in the following.

Behavior switch[edit | edit source]

A behavior switch is a directive. It includes or omits certain elements of the page interface or constitutes a call to various parts of the pages standard layout. It is characterised by using an upper case word, preceded and followed by two underscores.

Behavior switches can be put anywhere in the WikiCode of the designated page (usually written at the end of a page). One Exception is __TOC__ as it defines the place for the table of contents by being on the designated spot in the WikiCode.

Behavior switch Explanation
__NOEDITOR___ Prevents the use of WYSYWIG on current page
__NOTOC__ Hides the table of contents (ToC) on current page
__TOC__ Places ToC here (overriding any __NOTOC__). But: Multiple ToCs on one page are not supportet. If __TOC__ is used several times, only the first occurence causes a ToC to appear.
__NOEDITSECTION__ Hides the edit links beside headings.
__NEWSECTIONLINK__ Gives a "+"-link next to the edit-tab to make a new section on a non-talk page.

Variable[edit | edit source]

Built-in variables

Variable Output Description
{{SITENAME}} BlueSpice Wiki Name of the wiki
{{CURRENTTIME}} 14:19 Time (24-hour HH:mm format)
{{CURRENTDAY}} 7 Day of the month (unpadded number)
{{CURRENTMONTH}} 05 Month (zero-padded number)
{{NUMBEROFARTICLES}} 651 shows how many articles exist in wiki
{{NAMESPACE}} Manual tells namespace of the page
{{PAGENAME}} MagicWords Name of actual page

Variables taylored by HalloWelt

Variable Output Description
{{#hwinfobox:}} shows five latest changes and date when they occured
{{{#userslink:(who?)}} names all users who are online

Variables are words which are preceded by the symbols "{{" and followed by "}}" and followed by " }}" and followed by " }}". The word used is in all upper case.

Variables can be written into the WikiCode at designated place.


Further Information[edit | edit source]

Help on wikimedia.org [[en:</nowiki>". The word used is in all upper case." data-bs-type="template" data-bs-id="17">Template:'''". The word used is in all upper case.Manual:MagicWords]]

__NOTOC__
        
        
        
        ==What are Magic Words?==
        
        A "magic word" is a symbol recognized by the MediaWiki software. It triggers the software to do something other than display that symbol, or transclude a page with that name, but instead to use the symbol directly.
        
        
        
        
        
        
        
        ==How to use Magic Words==
        
        # Klick on edit on designated page
        
        # You can insert MagicWords with a special tool named [[InsertMagic]]. <br />You can choose between WYSIWYG editor [[File:InsertMagic.png|InsertMagic.png]] and wiki code [[File:InsertMagic-code.png|InsertMagic-code.png]] to insert MagicWords with InsertMagic. But it is also possible to type MagicWords into the wiki code.
        
        # Write magic word on designated place
        
        
        
        There can be distinguished three major kinds of magic words (behavior switches and variables) which will be defined in the following.
        
        
        
        ==Behavior switch==
        
        A behavior switch is a directive. It includes or omits certain elements of the page interface or constitutes a call to various parts of the pages standard layout. It is characterised by using an upper case word, preceded and followed by two underscores.
        
        
        
        Behavior switches can be put anywhere in the WikiCode of the designated page (usually written at the end of a page). One Exception is <nowiki>__TOC__</nowiki> as it defines the place for the table of contents by being on the designated spot in the WikiCode.
        
        
        
        {| class="wikitable" style="width: 70%;" border="2" cellspacing="0" cellpadding="4"
        
        |-
        
        !|Behavior switch
        
        !|Explanation
        
        |-
        
        ||<nowiki>__NOEDITOR__</nowiki>_
        
        ||Prevents the use of WYSYWIG on current page
        
        |-
        
        ||<nowiki>__NOTOC__</nowiki>
        
        ||Hides the table of contents (ToC) on current page
        
        
        
        |-
        
        ||<nowiki>__TOC__</nowiki>
        
        ||Places ToC here (overriding any <nowiki>__NOTOC__</nowiki>). But: Multiple ToCs on one page are not supportet. If <nowiki>__TOC__</nowiki> is used several times, only the first occurence causes a ToC to appear.
        
        |-
        
        ||<nowiki>__NOEDITSECTION__</nowiki>
        
        ||Hides the edit links beside headings.
        
        |-
        
        ||<nowiki>__NEWSECTIONLINK__</nowiki>
        
        ||Gives a "+"-link next to the edit-tab to make a new section on a non-talk page.
        
        |}
        
        ==Variable==
        
        '''Built-in variables'''
        
        
        
        {| class="wikitable" style="width: 70%;" border="2" cellspacing="0" cellpadding="4"
        
        |-
        
        !|Variable
        
        !|Output
        
        !|Description
        
        |-
        
        ||<nowiki>{{SITENAME}}</nowiki>
        
        ||{{SITENAME}}
        
        ||Name of the wiki
        
        |-
        
        ||<nowiki>{{CURRENTTIME}}</nowiki>
        
        ||{{CURRENTTIME}}
        
        ||Time (24-hour HH:mm format)
        
        |-
        
        ||<nowiki>{{CURRENTDAY}}</nowiki>
        
        ||{{CURRENTDAY}}
        
        ||Day of the month (unpadded number)
        
        |-
        
        ||<nowiki>{{CURRENTMONTH}}</nowiki>
        
        ||{{CURRENTMONTH}}
        
        ||Month (zero-padded number)
        
        |-
        
        ||<nowiki>{{NUMBEROFARTICLES}}</nowiki>
        
        ||{{NUMBEROFARTICLES}}
        
        ||shows how many articles exist in wiki
        
        |-
        
        ||<nowiki>{{NAMESPACE}}</nowiki>
        
        ||{{NAMESPACE}}
        
        ||tells namespace of the page
        
        |-
        
        ||<nowiki>{{PAGENAME}}</nowiki>
        
        ||{{PAGENAME}}
        
        ||Name of actual page
        
        |}
        
        
        
        '''Variables taylored by HalloWelt'''
        
        
        
        {| class="wikitable" style="width: 70%;" border="2" cellspacing="0" cellpadding="4"
        
        |-
        
        !|Variable
        
        !|Output
        
        !|Description
        
        |-
        
        ||<nowiki>{{#hwinfobox:}}</nowiki>
        
        ||
        
        ||shows five latest changes and date when they occured
        
        |-
        
        ||<nowiki>{{{#userslink:(who?)}}</nowiki>
        
        ||
        
        ||names all users who are online
        
        |}
        
        
        
        Variables are words which are preceded by the symbols "'''<nowiki>{{</nowiki>'''" and followed by "'''<nowiki>}}</nowiki>'''" and followed by "'''<nowiki> }}</nowiki>'''" and followed by "'''<nowiki> }}</nowiki>'''". The word used is in all upper case.
        
        
        
        Variables can be written into the WikiCode at designated place.
        
        
        
        
        
        
        
        ==Further Information==
        
        [http://meta.wikimedia.org/wiki/Help:Magic_words Help on wikimedia.org]
        
        [[en:{{</nowiki>'''". The word used is in all upper case." data-bs-type="template" data-bs-id="17">{{ '''". The word used is in all upper case. }}{{FULLPAGENAME}}]][[de:MagicWords]]
Line 94: Line 94:
 
|}
 
|}
  
Variables are words which are preceded by the symbols "'''<nowiki>{{</nowiki>'''" and followed by "'''<nowiki>}}</nowiki>'''" and followed by "'''<nowiki> }}</nowiki>'''". The word used is in all upper case.
+
Variables are words which are preceded by the symbols "'''<nowiki>{{</nowiki>'''" and followed by "'''<nowiki>}}</nowiki>'''" and followed by "'''<nowiki> }}</nowiki>'''" and followed by "'''<nowiki> }}</nowiki>'''". The word used is in all upper case.
  
 
Variables can be written into the WikiCode at designated place.
 
Variables can be written into the WikiCode at designated place.
Line 102: Line 102:
 
==Further Information==
 
==Further Information==
 
[http://meta.wikimedia.org/wiki/Help:Magic_words Help on wikimedia.org]
 
[http://meta.wikimedia.org/wiki/Help:Magic_words Help on wikimedia.org]
[[en:{{FULLPAGENAME}}]][[de:MagicWords]]
+
[[en:</nowiki>'''". The word used is in all upper case." data-bs-type="template" data-bs-id="17">{{ '''". The word used is in all upper case. }}{{FULLPAGENAME}}]][[de:MagicWords]]

Attachments

Discussions