Template:TemplateData header

From BAMOS Wiki
Revision as of 18:10, 26 January 2022 by RoS (talk | contribs) (Created page with "<noinclude> <languages/> <onlyinclude>{{#switch:<translate></translate> |= <div class="templatedata-header"><!-- -->{{#if:{{yesno|{{{editlinks|}}}}}<!-- -->|{{#ifexpr:<!--...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

<languages/> {{#switch:<translate></translate> |=

{{#if:{{safesubst:#switch:
|no
|n
|false
|0        = 
|         = 
|¬        = 
|yes
|y
|true
|1        = yes
|#default = yes

}}|{{#ifexpr:{{#if:|{{#ifeq:Template:TemplateData header|{{#switch:

|#default =  
| = 
   {{#ifeq:  | 
     | Template:{{{docpage}}}            
     |       
   }}

}}|0|1}}|not{{#ifexpr: ( {{#ifeq:templatedata header|doc|1|0}} or ( {{#ifeq:{{#titleparts:template:templatedata header|-1|-2}}|doc|1|0}} and {{#if:{{#invoke:Template translation|getLanguageSubpage}}|1|0}} ) )|1|0}}}}|<templatestyles src="Module:Navbar/styles.css"/>{{#if:1||{{#if:|{{{text}}}|<translate> This box:</translate>}} }}{{#if:1|[}}[[{{#switch:

|#default = TemplateData header/doc 
| = 
   {{#ifeq:  | 
     | Template:TemplateData header/doc            
     | TemplateData header/doc      
   }}

}}|<span style="" title="<translate nowrap> View this template</translate>">{{#if:|<translate> v</translate>|<translate> view</translate>}}]] · [[[:Template:Fullurl:]] <span style="" title="<translate nowrap> Discuss this template</translate>">{{#if:|<translate> d</translate>|<translate> talk</translate>}}]{{#if:|| · [{{fullurl:{{#switch:

|#default = TemplateData header/doc 
| = 
   {{#ifeq:  | 
     | Template:TemplateData header/doc            
     | TemplateData header/doc      
   }}

}}|action=edit}} <span style="" title="<translate nowrap> Edit this template</translate>">{{#if:|<translate> e</translate>|<translate> edit</translate>}}]}}{{#if:1|]}}}}}} {{#if:||<translate> This is the [[<tvar name=1>Special:MyLanguage/Help:TemplateData</tvar>|TemplateData]] documentation for this template used by [[<tvar name=2>Special:MyLanguage/VisualEditor</tvar>|VisualEditor]] and other tools.</translate>}}

TemplateData header

| #default=

 {{#invoke:Template translation|renderTranslatedTemplate|template=Template:TemplateData header|noshift=1|uselang={{#if:Template:Pagelang|Template:Pagelang|⧼lang⧽}}}}

}} {{#invoke:documentation|main|_content={{ {{#invoke:documentation|contentTitle}}}}}}{{#if:Inserts a brief header for the template data section. Adds the /doc subpage to [[:Category:TemplateData documentation{{#translation:}}]] and the template page to [[:Category:Templates using TemplateData{{#translation:}}]].

Usage

<syntaxhighlight lang="html">

TemplateData== or ==Parameters== or ==Usage

Template:((TemplateData headerTemplate:)) Template:^(templatedataTemplate:)^{ ... }Template:^(/templatedataTemplate:)^ </syntaxhighlight>

Use {{TemplateData header|Template name}} to display a name for the template other than the default, which is {{BASEPAGENAME}}.

{{#switch:<translate></translate> |=
{{#if:{{safesubst:#switch:
|no
|n
|false
|0        = 
|         = 
|¬        = 
|yes
|y
|true
|1        = yes
|#default = yes

}}|{{#ifexpr:{{#if:|{{#ifeq:Template:TemplateData header|{{#switch:

|#default =  
| = 
   {{#ifeq:  | 
     | Template:{{{docpage}}}            
     |       
   }}

}}|0|1}}|not{{#ifexpr: ( {{#ifeq:templatedata header|doc|1|0}} or ( {{#ifeq:{{#titleparts:template:templatedata header|-1|-2}}|doc|1|0}} and {{#if:{{#invoke:Template translation|getLanguageSubpage}}|1|0}} ) )|1|0}}}}|<templatestyles src="Module:Navbar/styles.css"/>{{#if:1||{{#if:|{{{text}}}|<translate> This box:</translate>}} }}{{#if:1|[}}[[{{#switch:

|#default = TemplateData header/doc 
| = 
   {{#ifeq:  | 
     | Template:TemplateData header/doc            
     | TemplateData header/doc      
   }}

}}|<span style="" title="<translate nowrap> View this template</translate>">{{#if:|<translate> v</translate>|<translate> view</translate>}}]] · [[[:Template:Fullurl:]] <span style="" title="<translate nowrap> Discuss this template</translate>">{{#if:|<translate> d</translate>|<translate> talk</translate>}}]{{#if:|| · [{{fullurl:{{#switch:

|#default = TemplateData header/doc 
| = 
   {{#ifeq:  | 
     | Template:TemplateData header/doc            
     | TemplateData header/doc      
   }}

}}|action=edit}} <span style="" title="<translate nowrap> Edit this template</translate>">{{#if:|<translate> e</translate>|<translate> edit</translate>}}]}}{{#if:1|]}}}}}} {{#if:||<translate> This is the [[<tvar name=1>Special:MyLanguage/Help:TemplateData</tvar>|TemplateData]] documentation for this template used by [[<tvar name=2>Special:MyLanguage/VisualEditor</tvar>|VisualEditor]] and other tools.</translate>}}

Template name

{{#ifeq:TemplateData header|sandbox||{{#if:{{#ifexpr: (

{{#ifeq:templatedata header|doc|1|0}} or ( {{#ifeq:{{#titleparts:template:templatedata header|-1|-2}}|doc|1|0}} and {{#if:{{#invoke:Template translation|getLanguageSubpage}}|1|0}} ) )|1|}}|[[Category:TemplateData documentation{{#translation:}}]]|[[Category:Templates using TemplateData{{#translation:}}]]}}}} | #default=

 {{#invoke:Template translation|renderTranslatedTemplate|template=Template:TemplateData header|noshift=1|uselang={{#if:Template:Pagelang|Template:Pagelang|⧼lang⧽}}}}

}}

Use {{TemplateData header|noheader=1}} to omit the first sentence of the header text.

{{#switch:<translate></translate> |=
{{#if:{{safesubst:#switch:
|no
|n
|false
|0        = 
|         = 
|¬        = 
|yes
|y
|true
|1        = yes
|#default = yes

}}|{{#ifexpr:{{#if:|{{#ifeq:Template:TemplateData header|{{#switch:

|#default =  
| = 
   {{#ifeq:  | 
     | Template:{{{docpage}}}            
     |       
   }}

}}|0|1}}|not{{#ifexpr: ( {{#ifeq:templatedata header|doc|1|0}} or ( {{#ifeq:{{#titleparts:template:templatedata header|-1|-2}}|doc|1|0}} and {{#if:{{#invoke:Template translation|getLanguageSubpage}}|1|0}} ) )|1|0}}}}|<templatestyles src="Module:Navbar/styles.css"/>{{#if:1||{{#if:|{{{text}}}|<translate> This box:</translate>}} }}{{#if:1|[}}[[{{#switch:

|#default = TemplateData header/doc 
| = 
   {{#ifeq:  | 
     | Template:TemplateData header/doc            
     | TemplateData header/doc      
   }}

}}|<span style="" title="<translate nowrap> View this template</translate>">{{#if:|<translate> v</translate>|<translate> view</translate>}}]] · [[[:Template:Fullurl:]] <span style="" title="<translate nowrap> Discuss this template</translate>">{{#if:|<translate> d</translate>|<translate> talk</translate>}}]{{#if:|| · [{{fullurl:{{#switch:

|#default = TemplateData header/doc 
| = 
   {{#ifeq:  | 
     | Template:TemplateData header/doc            
     | TemplateData header/doc      
   }}

}}|action=edit}} <span style="" title="<translate nowrap> Edit this template</translate>">{{#if:|<translate> e</translate>|<translate> edit</translate>}}]}}{{#if:1|]}}}}}} {{#if:1||<translate> This is the [[<tvar name=1>Special:MyLanguage/Help:TemplateData</tvar>|TemplateData]] documentation for this template used by [[<tvar name=2>Special:MyLanguage/VisualEditor</tvar>|VisualEditor]] and other tools.</translate>}}

TemplateData header

{{#ifeq:TemplateData header|sandbox||{{#if:{{#ifexpr: (

{{#ifeq:templatedata header|doc|1|0}} or ( {{#ifeq:{{#titleparts:template:templatedata header|-1|-2}}|doc|1|0}} and {{#if:{{#invoke:Template translation|getLanguageSubpage}}|1|0}} ) )|1|}}|[[Category:TemplateData documentation{{#translation:}}]]|[[Category:Templates using TemplateData{{#translation:}}]]}}}} | #default=

 {{#invoke:Template translation|renderTranslatedTemplate|template=Template:TemplateData header|noshift=1|uselang={{#if:Template:Pagelang|Template:Pagelang|⧼lang⧽}}}}

}}

Parameters

{{#switch:<translate></translate> | = {{#if:{{#ifexpr: ( {{#ifeq:templatedata header|doc|1|0}} or ( {{#ifeq:{{#titleparts:template:templatedata header|-1|-2}}|doc|1|0}} and {{#if:{{#invoke:Template translation|getLanguageSubpage}}|1|0}} ) )|1|}}

    | 

{{#ifeq:show |show

         | Template:Mbox
        }}{{#if: |
         |   {{#ifexist:Template:TemplateData header
                  | [[Category:{{#switch:Template
                          | Template | Project = Template
                          | Module   = Module
                          | User     = User
                          | #default = MediaWiki
                      }} documentation pages{{#translation:}}]]
                  | [[Category:Documentation subpages without corresponding pages{{#translation:}}]]
                 }}
        }}
    | 
   }}

| #default=

 {{#invoke:Template translation|renderTranslatedTemplate|template=Template:Documentation subpage|noshift=1|uselang=⧼lang⧽}}

}} {{#switch:<translate></translate> |=

{{#if:{{safesubst:#switch: 1
|no
|n
|false
|0        = 
|         = 
|¬        = 
|yes
|y
|true
|1        = yes
|#default = yes

}}|{{#ifexpr:{{#if:TemplateData header/doc|{{#ifeq:Template:TemplateData header|{{#switch:

|#default = TemplateData header/doc 
| = 
   {{#ifeq:  | 
     | Template:TemplateData header/doc            
     | TemplateData header/doc      
   }}

}}|0|1}}|not{{#ifexpr: ( {{#ifeq:templatedata header|doc|1|0}} or ( {{#ifeq:{{#titleparts:template:templatedata header|-1|-2}}|doc|1|0}} and {{#if:{{#invoke:Template translation|getLanguageSubpage}}|1|0}} ) )|1|0}}}}|<templatestyles src="Module:Navbar/styles.css"/>{{#if:1||{{#if:|{{{text}}}|<translate> This box:</translate>}} }}{{#if:1|[}}[[{{#switch:

|#default = TemplateData header/doc 
| = 
   {{#ifeq:  | 
     | Template:TemplateData header/doc            
     | TemplateData header/doc      
   }}

}}|<span style="" title="<translate nowrap> View this template</translate>">{{#if:|<translate> v</translate>|<translate> view</translate>}}]] · [[[:Template:Fullurl:]] <span style="" title="<translate nowrap> Discuss this template</translate>">{{#if:|<translate> d</translate>|<translate> talk</translate>}}]{{#if:|| · [{{fullurl:{{#switch:

|#default = TemplateData header/doc 
| = 
   {{#ifeq:  | 
     | Template:TemplateData header/doc            
     | TemplateData header/doc      
   }}

}}|action=edit}} <span style="" title="<translate nowrap> Edit this template</translate>">{{#if:|<translate> e</translate>|<translate> edit</translate>}}]}}{{#if:1|]}}}}}} {{#if:||<translate> This is the [[<tvar name=1>Special:MyLanguage/Help:TemplateData</tvar>|TemplateData]] documentation for this template used by [[<tvar name=2>Special:MyLanguage/VisualEditor</tvar>|VisualEditor]] and other tools.</translate>}}

TemplateData header

{{#ifeq:TemplateData header|sandbox||{{#if:{{#ifexpr: (

{{#ifeq:templatedata header|doc|1|0}} or ( {{#ifeq:{{#titleparts:template:templatedata header|-1|-2}}|doc|1|0}} and {{#if:{{#invoke:Template translation|getLanguageSubpage}}|1|0}} ) )|1|}}|[[Category:TemplateData documentation{{#translation:}}]]|[[Category:Templates using TemplateData{{#translation:}}]]}}}} | #default=

 {{#invoke:Template translation|renderTranslatedTemplate|template=Template:TemplateData header|noshift=1|uselang={{#if:Template:Pagelang|Template:Pagelang|⧼lang⧽}}}}

}} <templatedata> { "description": "Inserts a brief header for the template data section.", "format": "inline", "params": { "1": { "label": "Template name", "description": "Used to display a name for the template other than the default, which is TemplateData header.", "type": "string", "required": false }, "noheader": { "label": "No header", "description": "Assigning any value to this parameter will cause the template to omit the first sentence of the header text.", "type": "string", "required": false }, "editlinks": { "label": "Edit Links?", "description": "Whether to show <templatestyles src="Module:Navbar/styles.css"/>{{#if:||{{#if:|{{{text}}}|<translate> This box:</translate>}} }}{{#if:|[}}[[{{#switch:

|#default =  
| = 
   {{#ifeq:  | 
     | Template:{{{1}}}            
     |       
   }}

}}|<span style="" title="<translate nowrap> View this template</translate>">{{#if:|<translate> v</translate>|<translate> view</translate>}}]] · [[[:Template:Fullurl:]] <span style="" title="<translate nowrap> Discuss this template</translate>">{{#if:|<translate> d</translate>|<translate> talk</translate>}}]{{#if:|| · [{{fullurl:{{#switch:

|#default =  
| = 
   {{#ifeq:  | 
     | Template:{{{1}}}            
     |       
   }}

}}|action=edit}} <span style="" title="<translate nowrap> Edit this template</translate>">{{#if:|<translate> e</translate>|<translate> edit</translate>}}]}}{{#if:|]}} editlinks on pages that transclude the TemplateData", "default": "0", "autovalue": "1", "type": "boolean" }, "docpage": { "label": "Doc Page", "description": "The name of the current page, used for <templatestyles src="Module:Navbar/styles.css"/>{{#if:||{{#if:|{{{text}}}|<translate> This box:</translate>}} }}{{#if:|[}}[[{{#switch:

|#default =  
| = 
   {{#ifeq:  | 
     | Template:{{{1}}}            
     |       
   }}

}}|<span style="" title="<translate nowrap> View this template</translate>">{{#if:|<translate> v</translate>|<translate> view</translate>}}]] · [[[:Template:Fullurl:]] <span style="" title="<translate nowrap> Discuss this template</translate>">{{#if:|<translate> d</translate>|<translate> talk</translate>}}]{{#if:|| · [{{fullurl:{{#switch:

|#default =  
| = 
   {{#ifeq:  | 
     | Template:{{{1}}}            
     |       
   }}

}}|action=edit}} <span style="" title="<translate nowrap> Edit this template</translate>">{{#if:|<translate> e</translate>|<translate> edit</translate>}}]}}{{#if:|]}} edit links", "default": "TemplateData header/doc", "autovalue": "TemplateData header/doc", "suggested": true, "type": "wiki-template-name" } }, "paramOrder": [ "1", "noheader", "editlinks", "docpage" ] } </templatedata> Template:Sandbox other| [[Category:Template documentation pages{{#translation:}}]] }}