Template:Documentation subpage: Difference between revisions

mNo edit summary
mNo edit summary
 
(3 intermediate revisions by the same user not shown)
Line 1: Line 1:
{{#ifeq:{{SUBPAGENAME}}|doc|
{{#ifeq:{{SUBPAGENAME}}|doc|
<div class="documentation-subpage" style="border: 1px solid #ccc; background-color: #f9f9f9; padding: 1em; margin: 1em 0;">
<div class="documentation-subpage" style="border: 1px solid #ccc; background-color: #f9f9f9; padding: 1em; margin: 1em 0;">
This is the <code>/doc</code> subpage of [[{{{1}}}]]. Any changes made here will reflect on the main template page.
This is the <code>/doc</code> subpage of [[{{#titleparts:{{FULLPAGENAME}}|1}}]]. Any changes made here will reflect on the main template page.
[[Category:Documentation subpages]]
[[Category:{{{cat|Documentation subpages}}}]]
</div>}}<noinclude>
</div>}}<noinclude>
<templatedata>
<templatedata>
{
{
"params": {
"params": {
"cat": {
"label": "Category",
"description": "Specifies which category to label the template under.",
"type": "string",
"default": "Documentation subpages",
"suggested": true
},
"1": {
"1": {
"label": "Base page name",
"label": "Base page name",
Line 15: Line 22:
}
}
},
},
"description": "Used on /doc subpages to display that this is a documentation subpage of a template. If no parameter is passed, it defaults to the base name of the current page.",
"description": "Used on /doc subpages to display that the current page is a documentation subpage of a template. If no parameter is passed, it defaults to the base name of the current page.",
"paramOrder": [
"paramOrder": [
"1"
"1",
"cat"
]
]
}
}
Line 29: Line 37:
This is the <code>/doc</code> subpage of [[:Template:Documentation subpage]]. Any changes made here will reflect on the main template page.</div>
This is the <code>/doc</code> subpage of [[:Template:Documentation subpage]]. Any changes made here will reflect on the main template page.</div>
[[Category:Documentation templates]]
[[Category:Documentation templates]]
[[Category:Templates with parameters (optional)]]
</noinclude>
</noinclude>

Latest revision as of 17:38, 31 July 2025

Used on /doc subpages to display that the current page is a documentation subpage of a template. If no parameter is passed, it defaults to the base name of the current page.

[Edit template data]

Template parameters

ParameterDescriptionTypeStatus
Base page name1

If set, overrides the automatically detected base template name (used when this template fails to detect the parent template).

Example
Template:MyTemplate
Stringoptional
Categorycat

Specifies which category to label the template under.

Default
Documentation subpages
Stringsuggested

Basic usage

In most cases, the following code is sufficient on its own:

<noinclude>
{{Documentation subpage}}
</noinclude>

However, a parameter may need to be specified if:

  • The documentation is used on a page that is not a subpage. (e.g. test pages)
  • The documentation is for a non-template page. (e.g. Module: pages)
  • One or both pages use non-standard naming conventions. (e.g. {{Documentation subpage|Template:Artist/Album}})
<noinclude>
{{Documentation subpage|The page you want to point to}}
</noinclude>

Example

Below is a working example using a subpage at Template:Documentation subpage/doc:

This is the /doc subpage of Template:Documentation subpage. Any changes made here will reflect on the main template page.