Template:When on basepage/doc

From Zoophilia Wiki
Revision as of 00:20, 4 November 2009 by meta>Davidgothberg (Starting out this documentation. Intermediate save.)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigationJump to search

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


See also