Template:When on basepage/doc
| This is a documentation subpage for Template:When on basepage. It may contain usage information, categories and other content that is not part of the original template page. |
This is the {{basepage subpage}} meta-template.
This template helps other templates detect if they are on a basepage, a subpage or a subsubpage.
Usage
This template takes one or more parameters, like this:
{{basepage subpage
| Basepage text
| Subpage text
}}
If the template is on the page "User:Example", it will return this:
- Subpage text
If the template is on "User:Example/test", or "User:Example/test/test", or any page lower than that, it will return this:
- Subpage text
This template can also detect "subsubpages", like this:
{{basepage subpage
| Basepage text
| Subpage text
| Subsubpage text
}}
If the template is on "User:Example/test/test" or any page lower than that, it will return this:
- Subpage text
By using an empty parameter you can make it so the template doesn't render anything for some specific page type. Like this:
{{basepage subpage
| Basepage text
| Subpage text
|
}}
- Subpage text
The code above will render nothing when on "User:Example/test/test" or lower, but will return this when on "User:Example/test":
- Subpage text