Jump to content

Template:Documentation subpage: Difference between revisions

From We Are Calloway
w:c:templates>Waddie96
change icon
m 1 revision imported
Line 1: Line 1:
<noinclude>
<div style="margin:0; padding:1em; border: 0.5px solid #444c4d; border-radius:10px; display: flex; align-items: center;">
<languages/>
<div>
</noinclude>{{#switch:<translate></translate>
[[File:Edit-copy green.svg|left|40px|link=]]</div><div>
| =
'''This is a {{#switch: {{SUBJECTSPACE}} | Template = template | Module = module | user = user page | #default = page }} documentation [[mw:Help:Subpages|subpage]] for {{{1|[[:{{SUBJECTSPACE}}:{{BASEPAGENAME}}]]}}}.''' <br/><!--
<includeonly><!--
-->{{#if:{{IsDocSubpage|override={{{override|doc}}}|false=}}
    | <!--(this template has been transcluded on a /doc or /{{{override}}} page)-->
</includeonly><!--


      -->{{#ifeq:{{{doc-notice|show}}} |show
-->It contains usage information, [[w:Help:Category|categories]], [[w:Help:Interlanguage links|interlanguage links]] and other content that is not part of the original {{#if: {{{text2|}}} | {{{text2}}} | {{ #if: {{{text1|}}} | {{{text1}}} | {{ #ifeq: {{SUBJECTSPACE}} | {{ns:User}} | {{lc:{{SUBJECTSPACE}}}} template page | {{ #if: {{SUBJECTSPACE}} | {{lc:{{SUBJECTSPACE}}}} page|article}}}}}}}}.<!--
          | {{Mbox
            | type = notice
            | style = margin-bottom:1.0em;
            | image = [[File:Codex icon book color-base.svg|40px|alt=|class=skin-invert]]
            | text =
'''<translate><!--T:4--> This is a [[w:Wikipedia:Template documentation|documentation]] [[<tvar name=2>Special:MyLanguage/Help:Subpages</tvar>|subpage]] for <tvar name=1>{{{1|[[:{{SUBJECTSPACE}}:{{BASEPAGENAME}}]]}}}</tvar>.</translate>'''<br /><!--
-->{{#if:{{{text2|}}}{{{text1|}}}
  |<translate><!--T:5--> It contains usage information, [[<tvar name=7>Special:MyLanguage/Help:Categories</tvar>|categories]] and other content that is not part of the original <tvar name=1>{{{text2|{{{text1}}}}}}</tvar>.</translate>
  |<translate><!--T:10--> It contains usage information, [[<tvar name=7>Special:MyLanguage/Help:Categories</tvar>|categories]] and other content that is not part of the original <tvar name=1>{{SUBJECTSPACE}}</tvar> page.</translate>
  }}
            }}
        }}<!--


      -->{{DEFAULTSORT:{{{defaultsort|{{PAGENAME}}}}}}}<!--
--><includeonly>[[Category:{{#switch: {{SUBJECTSPACE}} | Template = Template | Module = Module | User = User | #default = Page }} documentation]]</includeonly><!--
 
--></div></div><noinclude>
      -->{{#if:{{{inhibit|}}} |<!--(don't categorize)-->
{{Documentation|fr=Modèle:Sous-page documentation|tr=Şablon:Belgelendirme alt sayfası}}
          |  <includeonly><!--
              -->{{#ifexist:{{NAMESPACE}}:{{BASEPAGENAME}}
                  | [[Category:{{#switch:{{SUBJECTSPACE}}
                          | Template | Project = Template
                          | Module   = Module
                          | User     = User
                          | #default = MediaWiki
                      }} documentation pages{{#translation:}}]]
                  | [[Category:Documentation subpages without corresponding pages{{#translation:}}]]
                  }}<!--
          --></includeonly>
        }}<!--
 
(completing initial #ifeq: at start of template:)
--><includeonly>
    | <!--(this template has not been transcluded on a /doc or /{{{override}}} page)-->
    }}<!--
--></includeonly>
| #default=
  {{#invoke:Template translation|renderTranslatedTemplate|template=Template:Documentation subpage|noshift=1|uselang={{int:lang}}}}
}}<noinclude>
{{Documentation|content=
 
<translate>
== Usage == <!--T:6-->
 
<!--T:7-->
Use this template on Template Documentation subpage (/doc).
 
== See also == <!--T:8-->
</translate>
*{{tl|Documentation}}
*{{tl|tl}}
 
}}
</noinclude>
</noinclude>

Revision as of 23:30, 26 September 2025

This is a template documentation subpage for Template:Documentation subpage.
It contains usage information, categories, interlanguage links and other content that is not part of the original template page.
Template Documentation[view | edit | history | purge]

This template can be used on any template, module, or other documentation subpage.

Usage

{{Documentation subpage}}
OR
{{documentation subpage|[[main page to link to]]}}

Customization of text

To manually change the text of the template, the "text1=your text here" and/or "text2=your other text here" parameters can be specified. "text1=" changes the automatic text on the first line to your own word(s). "text2=" changes the automatic text on the second line to your own word(s). If "text1=" parameter is specified without the "text2=" parameter, both the first and second line of text will be custom based on the text given in the "text1=" parameter.

Example usage:

{{Documentation subpage|text1=custom first and second line text}}

{{Documentation subpage|text2=custom second line text only}}

{{Documentation subpage|text1=custom first line text|text2=custom second line text}}

How it is displayed

This template should be placed at the top of "/doc" pages. It changes output depending on where it is viewed:

  • On a "/doc" page, it displays a box explaining template documentation and links to the template page.
  • On other pages (i.e., pages transcluding the "/doc" page), the template will not show. The template page itself (which contains {{Documentation}}) will automatically note that the documentation is transcluded from a subpage.

Functions

In addition to the output message, the template categorizes pages to Category:Template documentation, Category:Module documentation, Category:User page documentation, or similar (named after the subject space), but only for documentation pages in namespaces with the subpage feature. It defaults the sort key to the page name without namespace (ie, "Foo" on "Template:Foo", so it would be sorted in categories under 'F').

The above documentation is transcluded from Template:Documentation subpage/doc. (edit | history)
Add categories to the /doc subpage. Subpages of this template.