Hi fellow wiki editors!

To help newly registered users get more familiar with the wiki (and maybe older users too) there is now a {{Welcome to the wiki}} template. Have a look at it and feel free to add it to new users discussion pages (and perhaps your own).

I have tried to keep the template short, but meaningful. /Johan G

Template:Basepage subpage

From FlightGear wiki
Jump to: navigation, search


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