The following template description is not displayed when the template is inserted in an article.

Goal

This template can be used for showing different text depending on whether a page is a basepage, a subpage or a subsubpage.

Usage

{{basepage subpage|text if basepage|text if subpage|text if subsbupage |page=}}

All parameters are optional.

text if basepage
Content to show if the page is a basepage.
text if subpage
Content to show if the page is a subpage.
text if subsbupage
Content to show if the page is a subsubpage.
page
Another page. If not used, the page the template is put on will be used.

Examples

{{basepage subpage
| Basepage text
| Subpage text
| Subsubpage text
}}
{{basepage subpage
| Basepage text
| Subpage text
| Subsubpage text
| page = Talk:Main page/Archive
}}
{{basepage subpage
| Basepage text
| Subpage text
| Subsubpage text
| page = {{{page|}}}
}}

Alternatives

A subpage can be detected without using a template using the parser functions #if: and #titleparts: like below:

{{#ifeq: {{#titleparts:{{PAGENAME}}|1|1}} | {{PAGENAME}} 
| ...then on base page...
| ...else on a subpage...
}}

Related templates